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

feat(relay): emit event when client connections are dropped #5869

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RolandSherwin
Copy link

Description

When a relay server has no more connection with a reserved client, it would remove the reservation and the drop the circuits without any information passed to the server. It will be useful to for a server to track all its reservations and to know when they're removed (without keeping track of the connections themselves).

This PR aims to notify the server when a reservation closes, with the emission of the following event

    /// A reservation has been closed.
    ReservationClosed { src_peer_id: PeerId },

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@RolandSherwin RolandSherwin force-pushed the close_reservation_on_zero_conn branch 2 times, most recently from 7f11002 to 1664632 Compare February 18, 2025 14:39
@RolandSherwin RolandSherwin force-pushed the close_reservation_on_zero_conn branch 2 times, most recently from ff5da99 to 961b273 Compare February 24, 2025 15:11
Copy link
Contributor

@elenaf9 elenaf9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit about the changelog entry, rest LGTM.
Thanks @RolandSherwin!

@RolandSherwin RolandSherwin force-pushed the close_reservation_on_zero_conn branch from bfd945b to 8fc7efe Compare February 25, 2025 10:10
@RolandSherwin RolandSherwin force-pushed the close_reservation_on_zero_conn branch from 8fc7efe to 4b4e462 Compare February 25, 2025 14:37
@RolandSherwin RolandSherwin changed the title feat(relay): emit event when all client connections are dropped feat(relay): emit event when client connections are dropped Feb 25, 2025
Copy link
Contributor

@elenaf9 elenaf9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @RolandSherwin!

@elenaf9
Copy link
Contributor

elenaf9 commented Feb 25, 2025

Ah sorry, metrics also needs version bump (only patch version though) and changelog entry.

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

Successfully merging this pull request may close these issues.

4 participants