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

replicaset_mode: allow api call in init state #217

Merged
merged 2 commits into from
Sep 13, 2023
Merged

Conversation

0x501D
Copy link
Member

@0x501D 0x501D commented Sep 4, 2023

In replicaset mode, the user can attempt to call public methods on the replica start.
For example, a single script is used for master and replica.

This patch allows you to call a public method in the INIT state without
interrupting the script by exiting with an obscure error.
It will only log an attempt to call a method from the check_state function,
which is present at the beginning of each public method.

Closes #216

@0x501D
Copy link
Member Author

0x501D commented Sep 4, 2023

On the other hand, you can close this pr and issue. Since this is not a bug, but a special case when the user, without checking the current state of the queue with the public state() method, calls the public method, and the queue at that moment is in the INIT state. In this case, the user script will abort with an ambiguous error.

Copy link
Contributor

@LeonidVas LeonidVas left a comment

Choose a reason for hiding this comment

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

Hi! Thank you for the patch.

@0x501D 0x501D force-pushed the 0x501D/fix-gh-216 branch 3 times, most recently from b7b4832 to 78cffa6 Compare September 8, 2023 11:07
In replicaset mode, the user can attempt to call public methods on the replica start.
For example, a single script is used for master and replica.

This patch allows you to call a public method in the INIT state without
interrupting the script by exiting with an obscure error.
It will only log an attempt to call a method from the check_state function,
which is present at the beginning of each public method.

Closes #216
@LeonidVas LeonidVas merged commit 6bc1d63 into master Sep 13, 2023
23 checks passed
@LeonidVas LeonidVas deleted the 0x501D/fix-gh-216 branch September 13, 2023 19:35
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.

in_replicaset mode: create_tube on replica problem:
2 participants