-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close on already registered vici errors (#30)
Currently if strong-duckling fails to read an event request the event handler is not unregistered as the methods return the request error. This can lead to a failure state where following stat collections try to register an event handler but fails as it is already registered as it was not unregistered before. Strong-duckling is unable to recover from this state. This change moves unregistration of event handlers into a defered function to ensure that if registration succeeds we will always attempt to unregister. RegisterEvent guarantees that it does not keep the handler registered in memory if any part of the vici registration process fails, which gives us the guarantee that we will never get into the mentioned bad state again. Signed-off-by: Bjørn Sørensen <[email protected]>
- Loading branch information
Bjørn
authored
Apr 14, 2021
1 parent
264bed6
commit 6ccb976
Showing
3 changed files
with
37 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters