Comments (5)
I'm getting the same on a newly installed pub using [email protected]
from epidemic-broadcast-trees.
great, okay this must have been caused by: https://github.com/dominictarr/epidemic-broadcast-trees/pull/18 (if someone connects who is blocked, disconnect them)
from epidemic-broadcast-trees.
Did a little digging and it seems to be a problem with the state tracking between ssb-ebt and this code. It seems to me like when this code ends the connection ssb-ebt doesn't notice, continues trying to use the connection, calls write, and triggers the error.
Here's a workaround patch that seems to get things working again for me. My intent was to make this layer not close the connection itself; rather let the upper layer deal with that and survive the intervening time.
diff --git a/stream.js b/stream.js
index f4646ef..2e975dc 100644
--- a/stream.js
+++ b/stream.js
@@ -79,12 +79,12 @@ EBTStream.prototype.abort = EBTStream.prototype.end = function (err) {
EBTStream.prototype.canSend = function () {
var state = this.peer.state.peers[this.remote]
return (
+ state &&
+ !state.blocked &&
this.sink &&
!this.sink.paused &&
!this.ended && (
- //missing state means this peer was blocked,
- //end immediately.
- state.blocked || state.msgs.length || state.notes
+ state.msgs.length || state.notes
)
)
}
@@ -93,9 +93,7 @@ EBTStream.prototype.resume = function () {
var state = this.peer.state.peers[this.remote]
if(!this.sink || this.sink.paused) return
while(this.canSend()) {
- if(state.blocked)
- this.end()
- else if(state.msgs.length) {
+ if(state.msgs.length) {
if(this.peer.logging) console.error("EBT:send", JSON.stringify(state.msgs[0], null, 2))
this.sink.write(state.msgs.shift())
}
from epidemic-broadcast-trees.
I think the problem was actually in push-stream-to-pull-stream, if you update that to 1.0.3 (reinstall and you'll get it) and i think it should start working again.
from epidemic-broadcast-trees.
Updating seems to fix this issue, but introduces another. Unfortunately this means I can't run this fix for long term stability testing until the other issue is fixed. It does appear better though so I'll close this issue for now.
from epidemic-broadcast-trees.
Related Issues (20)
- document API in README HOT 5
- replicating with multiple peers
- Minor error in repo description, "broadtast" instead of broadcast HOT 1
- Crash in isAvailable HOT 2
- Crash replicating HOT 5
- Crash in canSend HOT 1
- 6.3.4 breaks scuttlebot tests HOT 1
- Add a `pauseRx(<feedId>, isPaused)` method.
- What is the `remote_stream` in the example code? HOT 1
- better protocol documentation HOT 1
- documentation drive: HOT 3
- notes.txt HOT 1
- Request skipping HOT 3
- Why are the seqno bitshifted in v3? HOT 1
- could not retrive msg: Error [NotFoundError]: Key not found in database HOT 3
- Is there a way to reset a remote clock HOT 7
- Document support sending clocks inside a thing with additional properties
- find a better name for fixSeq
- Loosely Based on Epidemic Broadcast Trees?! HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from epidemic-broadcast-trees.