-
-
Notifications
You must be signed in to change notification settings - Fork 782
Register internal trigger types in the init / setup phase of st2-register-content script #3542
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
Register internal trigger types in the init / setup phase of st2-register-content script #3542
Conversation
st2-register-content script. This should resolve the weird race issue @Arma spotted on Ubuntu 16.04.
| 2. Establishes DB connection | ||
| 3. Suppress DEBUG log level if --verbose flag is not used | ||
| 4. Registers RabbitMQ exchanges | ||
| 5. Registers internal trigger types (optional, disabled by default) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it worth to register trigger types only when --register-triggers is requested from the st2-register-content script?
Move this logic here: https://github.com/StackStorm/st2/blob/master/st2common/st2common/content/bootstrap.py#L128 instead of doing that every time in setup.
|
CI failure from e2e test is real: |
|
Confirming the fix. BeforeAfter |
|
Minor thing: as said before #3542 (comment), I think we should register trigger types only when Here is an example of incosistency: |
|
@armab We could do that - only register it when rules are to be registered, but it also doesn't hurt to do in each case. If it's too confusing for the user, we can simply remove the log messages in this scenario (or perhaps change level to debug). |
trigger registration.
to the correct place.
…thub.com:StackStorm/st2 into register_content_register_internal_trigger_types
arm4b
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for digging in and finding the fix! 👍
Also, we need a CHANGELOG (bugfix) update.
The should fix the race issue described in StackStorm/st2-packages#445.
Previously we didn't register internal trigger types inside this script so if user ran this script before any of the service which register them was started (e.g. st2api, st2stream, etc.) and rules were to be registered, the script would fail with "Failed to create trigger" error.
More context and explanation in StackStorm/st2-packages#445 and #3538 (comment).