fix: harden exception handling, break ARC cycles, sync license/client
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
Replace bare except: with CatchableError across storage, query, Raft, backup, and protocol code so Defects are not swallowed. Break uncollectable ARC cycles in server shard/gossip callbacks via Server-owned refs and cursor locals. Align package license with LICENSE (BSD-3-Clause), sync README version, and point test_all at the canonical clients/nim baradb client (parseConnectionString + aliases).
This commit is contained in:
@@ -202,7 +202,7 @@ proc applyCommitted(node: RaftNode) =
|
||||
let parts = entry.command.split(":")
|
||||
if parts.len >= 3:
|
||||
let action = parts[1]
|
||||
let txnId = try: parseUInt(parts[2]) except: 0'u64
|
||||
let txnId = try: parseUInt(parts[2]) except CatchableError: 0'u64
|
||||
if action == "PREPARE" and node.onDistTxnPrepare != nil:
|
||||
discard node.onDistTxnPrepare(txnId, @[])
|
||||
elif action == "COMMIT" and node.onDistTxnCommit != nil:
|
||||
@@ -564,7 +564,7 @@ proc connectToPeer(net: RaftNetwork, peerId: string) {.async.} =
|
||||
let sock = newAsyncSocket()
|
||||
await sock.connect(host, Port(port))
|
||||
net.peerSockets[peerId] = sock
|
||||
except:
|
||||
except CatchableError:
|
||||
discard
|
||||
|
||||
proc send*(net: RaftNetwork, peerId: string, msg: RaftMessage) {.async.} =
|
||||
@@ -577,7 +577,7 @@ proc send*(net: RaftNetwork, peerId: string, msg: RaftMessage) {.async.} =
|
||||
bigEndian32(addr header[0], unsafeAddr payloadLen)
|
||||
try:
|
||||
await net.peerSockets[peerId].send(cast[string](header) & cast[string](data))
|
||||
except:
|
||||
except CatchableError:
|
||||
net.peerSockets.del(peerId)
|
||||
|
||||
proc broadcast*(net: RaftNetwork, msgs: seq[RaftMessage]) {.async.} =
|
||||
@@ -615,9 +615,9 @@ proc receiveLoop(net: RaftNetwork, client: AsyncSocket) {.async.} =
|
||||
let msg = deserializeRaftMessage(payload)
|
||||
try:
|
||||
await net.processMessage(msg)
|
||||
except:
|
||||
except CatchableError:
|
||||
discard
|
||||
except:
|
||||
except CatchableError:
|
||||
discard
|
||||
finally:
|
||||
client.close()
|
||||
@@ -641,7 +641,7 @@ proc run*(net: RaftNetwork) {.async.} =
|
||||
try:
|
||||
let client = await net.socket.accept()
|
||||
asyncCheck net.receiveLoop(client)
|
||||
except:
|
||||
except CatchableError:
|
||||
break
|
||||
|
||||
proc stop*(net: RaftNetwork) =
|
||||
|
||||
Reference in New Issue
Block a user