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

Use tokio 0.1 (tokio reform updates) #199

Merged
merged 6 commits into from Dec 16, 2018

Conversation

Projects
None yet
3 participants
@surdus
Contributor

surdus commented Nov 19, 2018

Related issue #165

surdus added some commits Nov 19, 2018

@vi

This comment has been minimized.

Member

vi commented Nov 19, 2018

How does it compare to this repository?

@kellerkindt

This comment has been minimized.

kellerkindt commented Nov 20, 2018

Thans @surdus , you made it available just as I needed it. I am currently using it in production and besides some sporadic disconnects (upstream write buffer fills up, which might be caused by another change of mine), its running fine.

@surdus

This comment has been minimized.

Contributor

surdus commented Nov 20, 2018

How does it compare to this repository?

It is just tokio related updates with fix of all compile warnings (there were some related to deprecated methods). In repo you mentioned there is also updates for new hyper version as I see and looks it is still required some work to do (rust show warnings for some unused variables and deprecated methods). But in general looks like it also use new tokio

@vi

This comment has been minimized.

Member

vi commented Nov 20, 2018

So this pull request is probably for version 0.22.0 and enzious's version may be 0.23.0 (or later), if it would be ready.

@vi

This comment has been minimized.

Member

vi commented Dec 14, 2018

examples/async-client and websocat get race condition after this.

Server (websocat is based on current rust-websocket version):

$ websocat -b ws-l:127.0.0.1:2794 literal:12345
websocat: Unfortunately, serving multiple clients without --exit-on-eof (-E) or with -U option is prone to socket leak in this websocat version

rust-websocket without bug (2f9ab02):

$ strace -fo /dev/null target/debug/examples/async-client 
Connecting to ws://127.0.0.1:2794
Received Message: Binary([49, 50, 51, 52, 53])
Received Message: Close(None)
^C

$ strace -fo /dev/null target/debug/examples/async-client 
Connecting to ws://127.0.0.1:2794
Received Message: Binary([49, 50, 51, 52, 53])
Received Message: Close(None)
^C

$ strace -fo /dev/null target/debug/examples/async-client 
Connecting to ws://127.0.0.1:2794
Received Message: Binary([49, 50, 51, 52, 53])
Received Message: Close(None)
^C

$ strace -fo /dev/null target/debug/examples/async-client 
Connecting to ws://127.0.0.1:2794
Received Message: Binary([49, 50, 51, 52, 53])
Received Message: Close(None)
^C

$ strace -fo /dev/null target/debug/examples/async-client 
Connecting to ws://127.0.0.1:2794
Received Message: Binary([49, 50, 51, 52, 53])
Received Message: Close(None)
^C

$ strace -fo /dev/null target/debug/examples/async-client 
Connecting to ws://127.0.0.1:2794
Received Message: Binary([49, 50, 51, 52, 53])
Received Message: Close(None)
^C

rust-websocket with this pull request merged in:

$ strace -fo /dev/null target/debug/examples/async-client 
Connecting to ws://127.0.0.1:2794
^C

$ strace -fo /dev/null target/debug/examples/async-client 
Connecting to ws://127.0.0.1:2794
^C

$ strace -fo /dev/null target/debug/examples/async-client 
Connecting to ws://127.0.0.1:2794
^C

$ strace -fo /dev/null target/debug/examples/async-client 
Connecting to ws://127.0.0.1:2794
^C

$ target/debug/examples/async-client 
Connecting to ws://127.0.0.1:2794
Received Message: Binary([49, 50, 51, 52, 53])
Received Message: Close(None)
^C

$ target/debug/examples/async-client 
Connecting to ws://127.0.0.1:2794
Received Message: Binary([49, 50, 51, 52, 53])
Received Message: Close(None)
^C

$ target/debug/examples/async-client 
Connecting to ws://127.0.0.1:2794
Received Message: Close(None)
^C

$ target/debug/examples/async-client 
Connecting to ws://127.0.0.1:2794
Received Message: Binary([49, 50, 51, 52, 53])
Received Message: Close(None)
^C

The faster server and the slower client go, the more probability of missed message is. strace is just artificial slowdown.

@surdus

This comment has been minimized.

Contributor

surdus commented Dec 16, 2018

Should works now. The problem was in codec update, non processed data in input buffer were lost. @kellerkindt issues that you mentioned may be related to this.

@vi vi merged commit fcd85c1 into websockets-rs:master Dec 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment