Don't ignore nil devices in plugin fingerprint #9311
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Even if a plugin sends back an empty []*device.DeviceGroup, it's transformed to nil during the RPC between nomad and the plugin. This conditional block prevented the manager to trigger the logic for "first fingerprint received". This adds a lot of latency when starting nomad.
Our custom device plugin is returning an empty FingerprintResponse.Devices slice very often. Our temporary fix is to send a ][]*DeviceGroup with a "dummy" DeviceGroup if the slice is empty.
Not triggering the "first fingerprint received" adds 50s to nomad's startup time (because of the batch fingerprint timeout of 50s). In turn, this made our node exceed its hearbeat grace period with our leader when restarting it, revoking all vault tokens for its allocations, causing a restart of all our allocations because their tokens couldn't be renewed.
Removing the logic for f.Devices == nil does not appear to affect the functionality of the function.