jpillora / overseer

Monitorable, gracefully restarting, self-upgrading binaries in Go (golang)
MIT License
2.33k stars 209 forks source link

restart server : accept tcp 127.0.0.1:9507: use of closed network connection #78

Closed dxxjing closed 2 years ago

dxxjing commented 2 years ago

Simulate a time-consuming request, restart during the request process, and find that the old process cannot wait for the request to complete before exiting

dxxjing commented 2 years ago

Reason found

bourne-3 commented 1 year ago

Reason found I'm experiencing the same problem with the following error

accept tcp [::]:5001: use of closed network connection

I'm using the framework gin and this error occurs in restart.

jpillora commented 1 year ago

I think you can change the restart signal

On Sun, 6 Aug 2023 at 11:51 PM bourne-3 @.***> wrote:

Reason found I'm experiencing the same problem with the following error

accept tcp [::]:5001: use of closed network connection

I'm using the framework gin and this error occurs in restart.

— Reply to this email directly, view it on GitHub https://github.com/jpillora/overseer/issues/78#issuecomment-1666867429, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE2X47QDA67I6HEXJ27ZJTXT6OM5ANCNFSM53RL45SQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

glaslos commented 2 months ago

@dxxjing what was the solution? @bourne-3 did you solve this in combination with gin?

glaslos commented 2 months ago

Solved by implementing graceful restart with Chi: https://github.com/go-chi/chi/blob/master/_examples/graceful/main.go