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

Relay graceful shutdown implementation #203

Open
sameh-farouk opened this issue Dec 4, 2024 · 4 comments
Open

Relay graceful shutdown implementation #203

sameh-farouk opened this issue Dec 4, 2024 · 4 comments
Assignees

Comments

@sameh-farouk
Copy link
Member

sameh-farouk commented Dec 4, 2024

The RMB relay does not have a complete graceful shutdown implementation. Here are the key observations:

  1. The main relay server loop in src/relay/mod.rs runs in an infinite loop without any shutdown handling.
  2. The federation worker also runs in an infinite loop in src/relay/federation/mod.rs without shutdown handling.
  3. The chain event listener in src/events/mod.rs also lacks shutdown handling.

I recommend implementing proper graceful shutdown handling to ensure reliable operation, maintain data integrity, and prevent resource leaks.

To implement proper graceful shutdown, the relay should:

  1. Handle OS signals (SIGTERM, SIGINT)
  2. Propagate shutdown signals to all components
  3. Allow in-flight messages to complete
  4. Close active connections cleanly
  5. Flush any remaining data to Redis
  6. Clean up any resources
@Nabil-Salah Nabil-Salah self-assigned this Dec 4, 2024
@Nabil-Salah
Copy link
Contributor

5-12-2024

investigate how to do graceful shutdown in rust

@Nabil-Salah
Copy link
Contributor

11-12-2024

implemented graceful shutdown on files specified on the issue and opened a draft pr

@Nabil-Salah
Copy link
Contributor

12-12-2024

reviewed graceful shutdown pr
was in meet with ashraf about tracing a problem in rmb

@Nabil-Salah
Copy link
Contributor

2-1-2025

Start exploring Tokyo tutorial

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

No branches or pull requests

2 participants