Skip to content

[chore] improve error handling when invoking 'start' twice #418

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

Merged
merged 1 commit into from
Apr 25, 2025

Conversation

raboof
Copy link
Member

@raboof raboof commented Apr 25, 2025

Currently, when you run start twice with the same config, it will start the PekkoManagement extension once and return the same Uri. This is a convenient 'idempotence'. However, previously this would silently ignore the second invocation if the parameters of the two calls were different, leading to a race condition.

The change in this commit adds error handling so that if the second invocation uses different parameters, it will fail the second call with a sensible error message.

@raboof raboof force-pushed the double-start-error-handling branch from f4cea47 to 8e9c491 Compare April 25, 2025 07:50
@@ -0,0 +1,54 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* license agreements; and to You under the Apache License, version 2.0:
Copy link
Contributor

@pjfanning pjfanning Apr 25, 2025

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

oops, done!

Currently, when you run `start` twice with the same config, it will
start the PekkoManagement extension once and return the same `Uri`.
This is a convenient 'idempotence'. However, previously this would
silently ignore the second invocation if the parameters of the two
calls were different, leading to a race condition.

The change in this commit adds error handling so that if the second
invocation uses different parameters, it will fail the second call
with a sensible error message.
@raboof raboof force-pushed the double-start-error-handling branch from 8e9c491 to e484ab1 Compare April 25, 2025 08:53
Copy link
Contributor

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

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

lgtm

@raboof raboof merged commit ed6d977 into apache:main Apr 25, 2025
15 checks passed
@pjfanning
Copy link
Contributor

@raboof if you have time, could you back port this to 1.0.x branch?

@pjfanning pjfanning added this to the 1.1.1 milestone Apr 25, 2025
raboof added a commit to raboof/pekko-management that referenced this pull request Apr 26, 2025
Currently, when you run `start` twice with the same config, it will
start the PekkoManagement extension once and return the same `Uri`.
This is a convenient 'idempotence'. However, previously this would
silently ignore the second invocation if the parameters of the two
calls were different, leading to a race condition.

The change in this commit adds error handling so that if the second
invocation uses different parameters, it will fail the second call
with a sensible error message.
@raboof
Copy link
Member Author

raboof commented Apr 26, 2025

Sure, #420

pjfanning pushed a commit to raboof/pekko-management that referenced this pull request Apr 28, 2025
Currently, when you run `start` twice with the same config, it will
start the PekkoManagement extension once and return the same `Uri`.
This is a convenient 'idempotence'. However, previously this would
silently ignore the second invocation if the parameters of the two
calls were different, leading to a race condition.

The change in this commit adds error handling so that if the second
invocation uses different parameters, it will fail the second call
with a sensible error message.
pjfanning pushed a commit that referenced this pull request May 2, 2025
Currently, when you run `start` twice with the same config, it will
start the PekkoManagement extension once and return the same `Uri`.
This is a convenient 'idempotence'. However, previously this would
silently ignore the second invocation if the parameters of the two
calls were different, leading to a race condition.

The change in this commit adds error handling so that if the second
invocation uses different parameters, it will fail the second call
with a sensible error message.
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.

2 participants