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

Intermittent "Connection reset by peer" for in-process channel in a recv() with a queued message but no sender #29

Closed
jdm opened this issue Jan 18, 2016 · 1 comment · Fixed by #30

Comments

@jdm
Copy link
Member

jdm commented Jan 18, 2016

We got a panic in this code in Servo:

226                 Command::Exit(result) => {
227                     result.send(()).unwrap();
228                     break;
229                 }
...
382     pub fn exit(&self) {
383         let (response_chan, response_port) = ipc::channel().unwrap();
384         self.chan.send(Command::Exit(response_chan)).unwrap();
385         response_port.recv().unwrap();
386     }

The panic:

  │ thread 'Constellation' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 104, message: "Connection reset by peer" } }', ../src/libcore/result.rs:688

This is on Linux.

@jdm
Copy link
Member Author

jdm commented Jan 18, 2016

That's the unwrap on line 385 that's panicking.

@jdm jdm changed the title Intermittent "Connection reset by peer" for in-process channel with both ends intact Intermittent "Connection reset by peer" for in-process channel with a queued message but no sender Jan 18, 2016
@jdm jdm changed the title Intermittent "Connection reset by peer" for in-process channel with a queued message but no sender Intermittent "Connection reset by peer" for in-process channel in a recv() with a queued message but no sender Jan 18, 2016
pcwalton added a commit to pcwalton/ipc-channel that referenced this issue Jan 21, 2016
This reduces the probability that the receiver receives errors when we
close our end of the socket with data remaining.

Might fix servo#29.
pcwalton added a commit to pcwalton/ipc-channel that referenced this issue Jan 22, 2016
This reduces the probability that the receiver receives errors when we
close our end of the socket with data remaining.

There is deadlock potential with this patch, because turning on `SO_LINGER`
causes `close()` to block until the receiver has received all the data. If
deadlocks happen, a workaround will be to close sockets in a separate thread.
This is ugly and slow, so I don't want to do that unless we need to.

Might fix servo#29.
bors-servo pushed a commit that referenced this issue Jan 22, 2016
Turn on `SO_LINGER` for client communication sockets.

This reduces the probability that the receiver receives errors when we
close our end of the socket with data remaining.

There is deadlock potential with this patch, because turning on `SO_LINGER`
causes `close()` to block until the receiver has received all the data. If
deadlocks happen, a workaround will be to close sockets in a separate thread.
This is ugly and slow, so I don't want to do that unless we need to.

Might fix #29.

r? @jdm
bors-servo pushed a commit that referenced this issue Jan 22, 2016
Turn on `SO_LINGER` for client communication sockets.

This reduces the probability that the receiver receives errors when we
close our end of the socket with data remaining.

There is deadlock potential with this patch, because turning on `SO_LINGER`
causes `close()` to block until the receiver has received all the data. If
deadlocks happen, a workaround will be to close sockets in a separate thread.
This is ugly and slow, so I don't want to do that unless we need to.

Might fix #29.

r? @jdm
bors-servo pushed a commit that referenced this issue Jan 22, 2016
Turn on `SO_LINGER` for client communication sockets.

This reduces the probability that the receiver receives errors when we
close our end of the socket with data remaining.

There is deadlock potential with this patch, because turning on `SO_LINGER`
causes `close()` to block until the receiver has received all the data. If
deadlocks happen, a workaround will be to close sockets in a separate thread.
This is ugly and slow, so I don't want to do that unless we need to.

Might fix #29.

r? @jdm
bors-servo pushed a commit that referenced this issue Jan 22, 2016
Turn on `SO_LINGER` for client communication sockets.

This reduces the probability that the receiver receives errors when we
close our end of the socket with data remaining.

There is deadlock potential with this patch, because turning on `SO_LINGER`
causes `close()` to block until the receiver has received all the data. If
deadlocks happen, a workaround will be to close sockets in a separate thread.
This is ugly and slow, so I don't want to do that unless we need to.

Might fix #29.

r? @jdm
bors-servo pushed a commit that referenced this issue Jan 23, 2016
Turn on `SO_LINGER` for client communication sockets.

This reduces the probability that the receiver receives errors when we
close our end of the socket with data remaining.

There is deadlock potential with this patch, because turning on `SO_LINGER`
causes `close()` to block until the receiver has received all the data. If
deadlocks happen, a workaround will be to close sockets in a separate thread.
This is ugly and slow, so I don't want to do that unless we need to.

Might fix #29.

r? @jdm
bors-servo pushed a commit that referenced this issue Jan 25, 2016
Turn on `SO_LINGER` for client communication sockets.

This reduces the probability that the receiver receives errors when we
close our end of the socket with data remaining.

There is deadlock potential with this patch, because turning on `SO_LINGER`
causes `close()` to block until the receiver has received all the data. If
deadlocks happen, a workaround will be to close sockets in a separate thread.
This is ugly and slow, so I don't want to do that unless we need to.

Might fix #29.

r? @jdm
pcwalton added a commit to pcwalton/ipc-channel that referenced this issue Jan 25, 2016
This reduces the probability that the receiver receives errors when we
close our end of the socket with data remaining.

There is deadlock potential with this patch, because turning on `SO_LINGER`
causes `close()` to block until the receiver has received all the data. If
deadlocks happen, a workaround will be to close sockets in a separate thread.
This is ugly and slow, so I don't want to do that unless we need to.

Might fix servo#29.
bors-servo pushed a commit that referenced this issue Jan 25, 2016
Turn on `SO_LINGER` for client communication sockets.

This reduces the probability that the receiver receives errors when we
close our end of the socket with data remaining.

There is deadlock potential with this patch, because turning on `SO_LINGER`
causes `close()` to block until the receiver has received all the data. If
deadlocks happen, a workaround will be to close sockets in a separate thread.
This is ugly and slow, so I don't want to do that unless we need to.

Might fix #29.

r? @jdm
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

Successfully merging a pull request may close this issue.

1 participant