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

Implement Lame Duck Mode Event Handler #716

Merged
merged 6 commits into from
Jan 21, 2025

Conversation

pzajaczkowski
Copy link
Contributor

@pzajaczkowski pzajaczkowski commented Jan 15, 2025

Resolves #23

I had two ideas for approaching this issue:

  • Make WritableServerInfo property and add setter, that will check if LDM has changed to true
  • Add a trigger method that writes the event to a channel in NatsConnection and invoke it directly from NatsReadProtocolProcessor after recieving INFO from server with LDM.

I decided to go with first option.

There is one thing i am not sure of: should anything be passed as argument to the LameDuckModeActivated event? Currently, it is an empty string.

@mtmk
Copy link
Collaborator

mtmk commented Jan 16, 2025

@pzajaczkowski thanks for the PR. long overdue that issue ;)

  • Make WritableServerInfo property and add setter, that will check if LDM has changed to true
  • Add a trigger method that writes the event to a channel in NatsConnection and invoke it directly from NatsReadProtocolProcessor after recieving INFO from server with LDM.

I decided to go with first option.

I think that's fine.

There is one thing i am not sure of: should anything be passed as argument to the LameDuckModeActivated event? Currently, it is an empty string.

Potentially passing the host might be a interesting. Or a copy of the server info?

EDIT: What do you think about passing Uri of the host similar to the proposal in PR #712

pzajaczkowski and others added 2 commits January 21, 2025 15:45
The LDM request feature test uses added to server version 2.10.
Copy link
Collaborator

@mtmk mtmk 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 @pzajaczkowski

@mtmk mtmk merged commit b254e4c into nats-io:main Jan 21, 2025
10 checks passed
@pzajaczkowski pzajaczkowski deleted the ldm-event-handler branch January 22, 2025 13:24
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

Successfully merging this pull request may close these issues.

Implement Lame Duck Mode Event Handler
4 participants