Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Merge tombstone updates #3

Merged
merged 4 commits into from
Jul 13, 2021
Merged

Merge tombstone updates #3

merged 4 commits into from
Jul 13, 2021

Conversation

stephpalis
Copy link

No description provided.

RemcodM and others added 2 commits July 12, 2021 15:58
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.
@stephpalis stephpalis merged commit dac9591 into master Jul 13, 2021
@stephpalis stephpalis deleted the NW-3274-tombstone branch July 13, 2021 21:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants