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

Error while closing websocket #722

Closed
tisztamo opened this issue Jun 14, 2021 · 1 comment · Fixed by #723
Closed

Error while closing websocket #722

tisztamo opened this issue Jun 14, 2021 · 1 comment · Fixed by #723

Comments

@tisztamo
Copy link
Contributor

Julia 1.6.1
HTTP.jl dev

When I close the browser window while a websocket connection is opened, HTTP.jl regularly logs an error:

┌ Error: error handling request
│   exception =
│    IOError: stream is closed or unusable
│    Stacktrace:
│      [1] check_open
│        @ ./stream.jl:386 [inlined]
│      [2] uv_write_async(s::Sockets.TCPSocket, p::Ptr{UInt8}, n::UInt64)
│        @ Base ./stream.jl:1018
│      [3] uv_write(s::Sockets.TCPSocket, p::Ptr{UInt8}, n::UInt64)
│        @ Base ./stream.jl:981
│      [4] unsafe_write(s::Sockets.TCPSocket, p::Ptr{UInt8}, n::UInt64)
│        @ Base ./stream.jl:1064
│      [5] unsafe_write
│        @ ~/.julia/dev/HTTP/src/ConnectionPool.jl:174 [inlined]
│      [6] unsafe_write
│        @ ./io.jl:646 [inlined]
│      [7] write
│        @ ./io.jl:669 [inlined]
│      [8] closewrite(ws::HTTP.WebSockets.WebSocket{HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}; statuscode::Nothing)
│        @ HTTP.WebSockets ~/.julia/dev/HTTP/src/WebSockets.jl:195
│      [9] close(ws::HTTP.WebSockets.WebSocket{HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}; statuscode::Nothing)
│        @ HTTP.WebSockets ~/.julia/dev/HTTP/src/WebSockets.jl:242
│     [10] close
│        @ ~/.julia/dev/HTTP/src/WebSockets.jl:241 [inlined]

Coming on the error level, it is very annoying. Also, the exception trace logging sometime crashes Julia in multi-threaded, multi-connection scenarios (I am unable to reproduce the crash in any other way)

tisztamo added a commit to tisztamo/HTTP.jl that referenced this issue Jun 14, 2021
quinnj pushed a commit that referenced this issue Jun 17, 2021
@omus
Copy link
Contributor

omus commented Sep 18, 2021

Fix is included in the v0.9.11 release

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.

2 participants