This repository has been archived by the owner on Jun 21, 2023. It is now read-only.
forked from karlkfi/kubexit
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Ensure tombstones created before kubexit started are read This commit changes the `Watch` function inside the `tombstone` package to also emit an initial event besides the `fsnotify` events. This initial event is called immediatly when `Watch` is called and the watcher has been setup. This change allows kubexit to detect tombstones written before kubexit was started. This prevents possible race conditions as described by #8. In order for this change to work, the `tombstone.EventHandler` type was changed. It now requires a function with 3 arguments: The graveyard, the tombstone and the operation instead of an `fsnotify.Event`. Reason being that the initial event is not an `fsnotify.Event`. The functions implementing an `tombstone.EventHandler` are changed accordingly. This change on its own introduces a new bug where the tombstone is written as part of an initial event, but the child process will still start because `child.Start()` is being called after the watcher has been setup. To overcome this issue, the shutdown state of the child is tracked in a new flag, which is set if `ShutdownNow()` or `ShutdownWithTimeout()` is executed.
- Loading branch information
1 parent
179bf8b
commit dac9591
Showing
3 changed files
with
45 additions
and
19 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