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

Bug: Re-connection to the DB #110

Open
2 tasks done
iliesh opened this issue Oct 29, 2023 · 2 comments
Open
2 tasks done

Bug: Re-connection to the DB #110

iliesh opened this issue Oct 29, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@iliesh
Copy link

iliesh commented Oct 29, 2023

Describe the bug

When the application is running, and the DB is restarted, then the application panic with the following stack:

panic: repeated read on failed websocket connection

goroutine 50 [running]:
github.com/gorilla/websocket.(*Conn).NextReader(0xc0000e0580)
        /home/admin/go/pkg/mod/github.com/gorilla/websocket@v1.5.0/conn.go:1030 +0x4f4
github.com/gorilla/websocket.(*Conn).ReadMessage(0x129dfa0?)
        /home/admin/go/pkg/mod/github.com/gorilla/websocket@v1.5.0/conn.go:1093 +0x2f
github.com/surrealdb/surrealdb.go/internal/websocket.(*WebSocket).read(0xc00039c080, {0xca5720, 0xc0003f4480})
        /home/admin/go/pkg/mod/github.com/surrealdb/surrealdb.go@v0.2.1/internal/websocket/ws.go:140 +0x45
github.com/surrealdb/surrealdb.go/internal/websocket.(*WebSocket).initialize.func1()
        /home/admin/go/pkg/mod/github.com/surrealdb/surrealdb.go@v0.2.1/internal/websocket/ws.go:167 +0xac
created by github.com/surrealdb/surrealdb.go/internal/websocket.(*WebSocket).initialize in goroutine 1
        /home/admin/go/pkg/mod/github.com/surrealdb/surrealdb.go@v0.2.1/internal/websocket/ws.go:160 +0x8e
exit status 2

Steps to reproduce

run an application and then stop surrealdb

Expected behaviour

reconnect or return back an error to the application, and let developer decide what to do

SurrealDB version

1.0.0+20230913.54aedcd for linux on x86_64

Contact Details

iliusha.md@gmail.com

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@iliesh iliesh added the bug Something isn't working label Oct 29, 2023
@ElecTwix
Copy link
Contributor

Thanks for the issue.
As you said It needs to reconnect after the websocket connection is broken after other PRs merged I will look into this.

@phughk
Copy link
Contributor

phughk commented Dec 1, 2023

We do want a shared configuration between drivers about how we handle network traffic (timeouts, reconnects, circuiting breaking strategies etc). Overall this would need to be standardised but for now we could add a helper.

Would recommend adhering to existing golang standards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants