-
Notifications
You must be signed in to change notification settings - Fork 41
Fix consumer dead state bug #364
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
Conversation
| runActionWithExpectedResult(actionName, "dat/multipleValueTypes.json", expectedOutput, false) | ||
| } | ||
|
|
||
| it should "create a trigger, delete that trigger, and quickly create it again with successful trigger fires" in withAssetCleaner(wskprops) { |
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.
Test fails when used against provider without the included updates.
| logging.info('[{}] Found a change to an existing trigger'.format(change["id"])) | ||
|
|
||
| if existingConsumer.desiredState() == Consumer.State.Disabled and self.__isTriggerDocActive(document): | ||
| if existingConsumer.desiredState() == Consumer.State.Dead and self.__isTriggerDocActive(document): |
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.
For background info, there is a nanny running periodically that deletes consumers that are in a dead state. Since the consumer is already in a dead state waiting for the nanny to close the process, a quick recreate of the consumer -- within a 2 second time period -- will be ignored. Instead of ignoring the recreate we will manually delete the consumer so that it can be recreated. Normally a graceful shutdown using the nanny is preferred, but we have no other choice here.
| # Record the sequence in case the changes feed needs to be | ||
| # restarted. This way the new feed can pick up right where | ||
| # the old one left off. | ||
| self.lastSequence = change['seq'] |
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.
Moved this in case of an unexpected exceptions that could happen, allowing us to pick up where we left off.
jasonpet
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.
LGTM
When an existing consumer is deleted and then quickly recreated, that consumer will get stuck in a dead state. This can happen when using wskdeploy with a manifest that undeploys triggers and then immediately recreates those triggers quickly.