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

Stop pool connection on SIGINT #712

Closed
alexvanin opened this issue Sep 21, 2022 · 9 comments · Fixed by #721
Closed

Stop pool connection on SIGINT #712

alexvanin opened this issue Sep 21, 2022 · 9 comments · Fixed by #721
Assignees
Labels
U3 Regular
Milestone

Comments

@alexvanin
Copy link
Contributor

If pool is configured incorrectly, application freezes at NeoFS connection until timeout. Context is not canceled on SIGINT (^C).
I think this more of a SDK issue, but we can investigate it from here.

@KirillovDenis
Copy link
Contributor

Could you clarify the pool is configured incorrectly?

@alexvanin
Copy link
Contributor Author

alexvanin commented Sep 21, 2022

Try to start s3 gateway with s01.neofs.devenv:8080 endpoint without starting neofs-dev-env.
On my machine, gateway freezes and doesn't react on ^C until timeout.

@KirillovDenis
Copy link
Contributor

It seems here we don't accept any context

@alexvanin
Copy link
Contributor Author

Can you try to do a PoC with having application context in Dial?
All you need to do is to pass app context into rpc.Balance() as a client parameter: client.WithContext(ctx)?

@alexvanin
Copy link
Contributor Author

We found that app sleeps for 20 seconds. Not clear where this timeout is set.

@KirillovDenis
Copy link
Contributor

We found that app sleeps for 20 seconds. Not clear where this timeout is set.

It's interesting that when we start app via IDE (goland) the app sleeps only for 3 seconds

@KirillovDenis
Copy link
Contributor

Can you try to do a PoC with having application context in Dial? All you need to do is to pass app context into rpc.Balance() as a client parameter: client.WithContext(ctx)?

Yes. This solve the problem (^C stops app now):

2022-09-23T12:12:50.272+0300    warn    s3-gw/app_settings.go:144       skip, empty address
^C2022-09-23T12:12:51.230+0300  fatal   s3-gw/app.go:134        failed to dial connection pool  {"error": "at least one node must be healthy"}
main.newApp
        github.com/nspcc-dev/neofs-s3-gw/cmd/s3-gw/app.go:134
main.main
        github.com/nspcc-dev/neofs-s3-gw/cmd/s3-gw/main.go:63
runtime.main
        runtime/proc.go:250

@alexvanin
Copy link
Contributor Author

Blocked by nspcc-dev/neofs-sdk-go#343

@alexvanin
Copy link
Contributor Author

Unblocked. I guess it will be good to update all our components that use SDK to avoid connection freezing.

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

Successfully merging a pull request may close this issue.

2 participants