hashicorp/nomad · warning
devices updates already batched
Error message
devices updates already batched
What it means
batchDevicesUpdates registers the one-shot callback that flushes batched device node updates, guarded by devicesBatched under devicesMu. This error means the method was called a second time on the same batchNodeUpdates instance, which supports a single device fingerprint flush at client start.
Source
Thrown at client/node_updater.go:505
// used in the device manager to send device fingerprints to
func (b *batchNodeUpdates) updateNodeFromDevices(devices []*structs.NodeDeviceResource) {
b.devicesMu.Lock()
defer b.devicesMu.Unlock()
if b.devicesBatched {
b.devicesCB(devices)
return
}
b.devices = devices
}
// batchDevicesUpdates sends the batched device node updates by calling f with
// the devices
func (b *batchNodeUpdates) batchDevicesUpdates(f devicemanager.UpdateNodeDevicesFn) error {
b.devicesMu.Lock()
defer b.devicesMu.Unlock()
if b.devicesBatched {
return fmt.Errorf("devices updates already batched")
}
b.devicesBatched = true
f(b.devices)
return nil
}
View on GitHub (pinned to 482b49bf1a)
Solutions
- Call batchDevicesUpdates exactly once per batchNodeUpdates instance
- Construct a new batchNodeUpdates for each round that needs device batching
- Restructure restart paths so batching is only performed on the initial fingerprint round
Example fix
// before: batching devices twice on shared batcher
b.batchDevicesUpdates(fn)
b.batchDevicesUpdates(fn) // -> "devices updates already batched"
// after: guard with fresh instance or flag
if !b.devicesBatched {
b.batchDevicesUpdates(fn)
} else {
b = newBatchNodeUpdates()
b.batchDevicesUpdates(fn)
} Defensive patterns
Strategy: try-catch
Validate before calling
if b.devicesBatched {
return nil // devices already flushed/registered
} Try / catch
if err := b.batchDevicesUpdates(fn); err != nil {
if err.Error() == "devices updates already batched" {
logger.Debug("devices batch already registered; ignoring")
return nil
}
return err
} Prevention
- Register device batching only during the first fingerprint round
- Use a new batchNodeUpdates per fingerprint cycle
- Avoid duplicate device fingerprinter setup in client construction
- Log sentinel already-batched errors instead of failing startup when duplicates are possible
When it happens
Trigger: Calling batchNodeUpdates.batchDevicesUpdates (directly or via batchFirstFingerprints) more than once on the same batcher instance.
Common situations: Re-running the startup batching sequence after a fingerprint restart or reconnect; duplicated device fingerprinter setup; test suites reusing a single batchNodeUpdates across cases.
Related errors
- host volume updates already batched
- csi updates already batched
- driver updates already batched
- operation on unknown device(s) "%s/%s/%s" (%v): %v
- ErrPluginDisabled
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/a2f073ec58e7f402.
Report an issue: GitHub.