relay icon indicating copy to clipboard operation
relay copied to clipboard

SO_REUSEPORT for smooth restart

Open doc-sheet opened this issue 1 year ago • 2 comments

Hi! For a long time relay can't be restarted normally at least on upgrade.

2024-09-29T10:59:28.950928Z  INFO relay_system::controller: SIGTERM received, stopping in 8s
2024-09-29T10:59:28.950996Z  INFO relay_server::services::outcome_aggregator: outcome aggregator stopped
2024-09-29T10:59:28.957884Z  INFO relay_server::services::server: Shutting down HTTP server
2024-09-29T10:59:37.235282Z  INFO relay_server: relay shutdown complete
2024-09-29T10:59:41.930891Z  INFO relay::setup: launching relay from config folder /etc/relay

<...>

2024-09-29T10:59:41.955944Z ERROR relay_server::services::health_check: Health check probe 'auth' failed
2024-09-29T10:59:42.056752Z ERROR relay_log::utils: error=bind to interface failed error.sources=[Address already in use (os error 98)]

Relay version 24.9.0 from self-hosted image.

Could you add SO_REUSEPORT flag to socket?

https://docs.rs/tokio/latest/tokio/net/struct.TcpSocket.html#method.set_reuseport

doc-sheet avatar Sep 29 '24 11:09 doc-sheet

Fixes https://sentry.my.sentry.io/organizations/sentry/issues/1538083.

jjbayer avatar Sep 30 '24 08:09 jjbayer

Now also happening in integration tests: https://github.com/getsentry/relay/actions/runs/11105222683/job/30850929531?pr=4087#step:8:1471

jjbayer avatar Sep 30 '24 11:09 jjbayer