<commit_before>public final class MongoTransactionDatabase: MongoDatabase {
    public func commit() -> EventLoopFuture<Void> {
        self.pool.next(for: .writable).flatMap { connection in
            connection.executeCodable(
                CommitTransaction(),
                namespace: .administrativeCommand,
                in: self.transaction,
                sessionId: self.sessionId
            ).decodeReply(OK.self).map { _ in }
        }
    }
    
    public func abort() -> EventLoopFuture<Void> {
        self.pool.next(for: .writable).flatMap { connection in
            connection.executeCodable(
                AbortTransaction(),
                namespace: .administrativeCommand,
                in: self.transaction,
                sessionId: self.sessionId
            ).decodeReply(OK.self).map { _ in }
        }
    }
}

struct CommitTransaction: Codable {
    let commitTransaction = 1
    
    init() {}
}

struct AbortTransaction: Codable {
    let abortTransaction = 1
    
    init() {}
}

internal struct OK: Decodable {
    private enum CodingKeys: String, CodingKey {
        case ok
    }
    
    private let ok: Int

    public var isSuccessful: Bool { ok == 1 }

    init(from decoder: Decoder) throws {
        let container = try decoder.container(keyedBy: CodingKeys.self)
        self.ok = try container.decode(Int.self, forKey: .ok)
    }
}
<commit_msg>Hop eventloops in the returned futures from `transaction.abort` and transaction.commit`.<commit_after>public final class MongoTransactionDatabase: MongoDatabase {
    public func commit() -> EventLoopFuture<Void> {
        self.pool.next(for: .writable).flatMap { connection in
            connection.executeCodable(
                CommitTransaction(),
                namespace: .administrativeCommand,
                in: self.transaction,
                sessionId: self.sessionId
            ).decodeReply(OK.self).map { _ in }
        }._mongoHop(to: self.hoppedEventLoop)
    }
    
    public func abort() -> EventLoopFuture<Void> {
        self.pool.next(for: .writable).flatMap { connection in
            connection.executeCodable(
                AbortTransaction(),
                namespace: .administrativeCommand,
                in: self.transaction,
                sessionId: self.sessionId
            ).decodeReply(OK.self).map { _ in }
        }._mongoHop(to: self.hoppedEventLoop)
    }
}

struct CommitTransaction: Codable {
    let commitTransaction = 1
    
    init() {}
}

struct AbortTransaction: Codable {
    let abortTransaction = 1
    
    init() {}
}

internal struct OK: Decodable {
    private enum CodingKeys: String, CodingKey {
        case ok
    }
    
    private let ok: Int

    public var isSuccessful: Bool { ok == 1 }

    init(from decoder: Decoder) throws {
        let container = try decoder.container(keyedBy: CodingKeys.self)
        self.ok = try container.decode(Int.self, forKey: .ok)
    }
}

{'fraction_non_alphanumeric': 0.09414155096512021, 'fraction_numerical': 0.002031832035218422, 'mean_word_length': 2.0802919708029197, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2268336', 'n_tokens_mistral': 841, 'n_tokens_neox': 803, 'n_words': 193}