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

encryptedTCPSender.Send() holds a lock over a TCP send #126

Open
bboreham opened this issue Jan 28, 2020 · 1 comment
Open

encryptedTCPSender.Send() holds a lock over a TCP send #126

bboreham opened this issue Jan 28, 2020 · 1 comment
Labels

Comments

@bboreham
Copy link
Contributor

bboreham commented Jan 28, 2020

Lock is not released until the Send() returns.

Taken together with #125 this means it can hold a lock forever.

Sender and receiver each maintain state including a sequence number, so if we unlock before calling Send() it's possible that messages get out of order.

Seen at weaveworks/weave#3762

@bboreham bboreham added the bug label Jan 28, 2020
@bboreham
Copy link
Contributor Author

I am now thinking this is not a bug, on the basis:

  • there is one lock per outgoing socket
  • the Send() on the socket will block all callers when the buffer is full

therefore it doesn't make any difference if we block earlier on the lock.

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

No branches or pull requests

1 participant