Skip to content

Commit

Permalink
Don't ignore nil devices in plugin fingerprint
Browse files Browse the repository at this point in the history
Even if a plugin sends back an empty `[]*device.DeviceGroup`, it's transformed to `nil` during the RPC. Our custom device plugin is returning empty `FingerprintResponse.Devices` very often. Our temporary fix is to send a dummy `*DeviceGroup` if the slice is empty. This has the effect of never triggering the "first fingerprint" and therefore timing out after 50s.

In turn, this made our node exceed its hearbeat grace period when restarting it, revoking all vault tokens for its allocations, causing a restart of all our allocations because the token couldn't be renewed.

Removing the logic for `f.Devices == nil` does not appear to affect the functionality of the function.
  • Loading branch information
jeromegn committed Nov 10, 2020
1 parent 86067cb commit 66ddf62
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions client/devicemanager/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,6 @@ func (i *instanceManager) handleFingerprintError() {
// handleFingerprint stores the new devices and triggers the fingerprint output
// channel. An error is returned if the passed devices don't pass validation.
func (i *instanceManager) handleFingerprint(f *device.FingerprintResponse) error {
// If no devices are returned then there is nothing to do.
if f.Devices == nil {
return nil
}

// Validate the received devices
var validationErr multierror.Error
for i, d := range f.Devices {
Expand Down

0 comments on commit 66ddf62

Please sign in to comment.