Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught exception and crash when peer disconnects #280

Open
threshold862543 opened this issue Mar 2, 2024 · 0 comments
Open

Uncaught exception and crash when peer disconnects #280

threshold862543 opened this issue Mar 2, 2024 · 0 comments

Comments

@threshold862543
Copy link

threshold862543 commented Mar 2, 2024

With these versions of peerbit and @peerbit/document:

"@peerbit/document": "^6.0.7",
"peerbit": "^4.0.7"

This sometimes occurs when peers disconnect:

{"level":50,"time":1709393286729,"pid":53811,"hostname":"...","msg":"Failed to resolve all heads"}
{"level":50,"time":1709393286811,"pid":53811,"hostname":"...","msg":"Failed to resolve all heads"}
{"level":50,"time":1709393286962,"pid":53811,"hostname":"...","msg":"Failed to resolve all heads"}
{"level":50,"time":1709393287259,"pid":53811,"hostname":"...","msg":"Failed to resolve all heads"}
{"level":50,"time":1709393287276,"pid":53811,"hostname":"...","msg":"Failed to resolve all heads"}
{"level":50,"time":1709393287361,"pid":53811,"hostname":"...","msg":"Failed to resolve all heads"}
{"level":50,"time":1709393287468,"pid":53811,"hostname":"...","msg":"Failed to resolve all heads"}
{"level":50,"time":1709393287569,"pid":53811,"hostname":"...","msg":"Failed to resolve all heads"}
{"level":50,"time":1709393287763,"pid":53811,"hostname":"...","msg":"Failed to resolve all heads"}
{"level":50,"time":1709393288067,"pid":53811,"hostname":"...","msg":"Failed to resolve all heads"}
{"level":50,"time":1709393289841,"pid":53811,"hostname":"...","msg":"Failed to resolve all heads"}
{"level":40,"time":1709393290750,"pid":53811,"hostname":"...","module":"document-index","msg":"Did not reciveve responses from all shard"}
buildIndex: 0.053ms
2 pages total
{"level":50,"time":1709393290783,"pid":53811,"hostname":"...","module":"shared-log","msg":"Failed to find peer who updated their role: Failed to get message xIwZQRJ2daYJUEVCAbi/jF0esBEb87QzBL5EEangBVw= 2 P8xNaszfuq4rEZQc5mb2u5ccFQsnCC46+KPd9mG8RcM= delivery acknowledges from all nodes (0/1). Mode: SeekDelivery. Redundancy: 2"}
{"level":50,"time":1709393290783,"pid":53811,"hostname":"...","module":"shared-log","msg":"Failed to find peer who updated their role: Failed to get message xIwZQRJ2daYJUEVCAbi/jF0esBEb87QzBL5EEangBVw= 2 P8xNaszfuq4rEZQc5mb2u5ccFQsnCC46+KPd9mG8RcM= delivery acknowledges from all nodes (0/1). Mode: SeekDelivery. Redundancy: 2"}
file:///.../node_modules/@peerbit/stream/lib/esm/index.js:1129
                deliveryDeferredPromise.reject(new DeliveryError(`Failed to get message ${idString} ${filterMessageForSeenCounter} ${[
                                               ^

DeliveryError: Failed to get message xIwZQRJ2daYJUEVCAbi/jF0esBEb87QzBL5EEangBVw= 2 P8xNaszfuq4rEZQc5mb2u5ccFQsnCC46+KPd9mG8RcM= delivery acknowledges from all nodes (0/1). Mode: SeekDelivery. Redundancy: 2
    at Timeout.<anonymous> (file:///.../node_modules/@peerbit/stream/lib/esm/index.js:1129:48)
    at listOnTimeout (node:internal/timers:564:17)
    at process.processTimers (node:internal/timers:507:7)

This crashes the process, so different error handling could be nice.
Additionally, this sometimes happens, I'm not sure if it's the same or a different issue:

An uncaught exception occurred: At least one recipent became unreachable while delivering messsage of type DataMessage} to P8xNaszfuq4rEZQc5mb2u5ccFQsnCC46+KPd9mG8RcM=
Stack trace: Error: At least one recipent became unreachable while delivering messsage of type DataMessage} to P8xNaszfuq4rEZQc5mb2u5ccFQsnCC46+KPd9mG8RcM=
    at DirectSub.onUnreachable (file:///.../node_modules/@peerbit/stream/lib/esm/index.js:1104:52)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:731:20)
    at DirectSub.dispatchEvent (node:internal/event_target:673:26)
    at DirectSub.dispatchEvent (file:///.../node_modules/@libp2p/interface/dist/src/event-target.js:43:30)
    at DirectSub.onPeerUnreachable (file:///.../node_modules/@peerbit/stream/lib/esm/index.js:610:14)
    at DirectSub.onPeerUnreachable (file:///.../node_modules/@peerbit/pubsub/lib/esm/index.js:299:15)
    at DirectSub.removePeerFromRoutes (file:///.../node_modules/@peerbit/stream/lib/esm/index.js:580:18)
    at Timeout._onTimeout (file:///.../node_modules/@peerbit/stream/lib/esm/index.js:1074:30)
    at listOnTimeout (node:internal/timers:564:17)
    at process.processTimers (node:internal/timers:507:7)
{"level":50,"time":1709413828679,"pid":71927,"hostname":"...","module":"shared-log","msg":"Failed to find peer who updated their role: At least one recipent became unreachable while delivering messsage of type DataMessage} to P8xNaszfuq4rEZQc5mb2u5ccFQsnCC46+KPd9mG8RcM="}
{"level":50,"time":1709413828679,"pid":71927,"hostname":"...","module":"shared-log","msg":"Failed to find peer who updated their role: At least one recipent became unreachable while delivering messsage of type DataMessage} to P8xNaszfuq4rEZQc5mb2u5ccFQsnCC46+KPd9mG8RcM="}
{"level":50,"time":1709413828679,"pid":71927,"hostname":"...","module":"shared-log","msg":"Failed to find peer who updated their role: At least one recipent became unreachable while delivering messsage of type DataMessage} to P8xNaszfuq4rEZQc5mb2u5ccFQsnCC46+KPd9mG8RcM="}
...
{"level":50,"time":1709413828679,"pid":71927,"hostname":"...","module":"shared-log","msg":"Failed to find peer who updated their role: At least one recipent became unreachable while delivering messsage of type DataMessage} to P8xNaszfuq4rEZQc5mb2u5ccFQsnCC46+KPd9mG8RcM="}
{"level":50,"time":1709413828679,"pid":71927,"hostname":"...","module":"shared-log","msg":"Failed to find peer who updated their role: At least one recipent became unreachable while delivering messsage of type DataMessage} to P8xNaszfuq4rEZQc5mb2u5ccFQsnCC46+KPd9mG8RcM="}
{"level":50,"time":1709413828679,"pid":71927,"hostname":"...","module":"shared-log","msg":"Failed to find peer who updated their role: At least one recipent became unreachable while delivering messsage of type DataMessage} to P8xNaszfuq4rEZQc5mb2u5ccFQsnCC46+KPd9mG8RcM="}
{"level":50,"time":1709413844341,"pid":71927,"hostname":"...","module":"shared-log","msg":"Failed to find peer who updated their role: Stream to P8xNaszfuq4rEZQc5mb2u5ccFQsnCC46+KPd9mG8RcM= does not exist. Connection exist: false. Route exist: false"}
{"level":50,"time":1709413844341,"pid":71927,"hostname":"...","module":"shared-log","msg":"Failed to find peer who updated their role: Stream to P8xNaszfuq4rEZQc5mb2u5ccFQsnCC46+KPd9mG8RcM= does not exist. Connection exist: false. Route exist: false"}
{"level":50,"time":1709413844341,"pid":71927,"hostname":"...","module":"shared-log","msg":"Failed to find peer who updated their role: Stream to P8xNaszfuq4rEZQc5mb2u5ccFQsnCC46+KPd9mG8RcM= does not exist. Connection exist: false. Route exist: false"}
{"level":50,"time":1709413844352,"pid":71927,"hostname":"...","module":"shared-log","msg":"Failed to find peer who updated their role: Stream to P8xNaszfuq4rEZQc5mb2u5ccFQsnCC46+KPd9mG8RcM= does not exist. Connection exist: false. Route exist: false"}
Segmentation fault (core dumped)
error Command failed with exit code 139.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant