client: fix JSON formatted logs when failing to reserve cores (#25523)

Fixed a bug where JSON formatted logs would not show the requested and overlapping 
cores when failing to reserve cores
This commit is contained in:
Martijn Vegter
2025-03-27 13:52:32 +01:00
committed by GitHub
parent 601e7ad3ab
commit 736103aa54
2 changed files with 4 additions and 1 deletions

3
.changelog/25523.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:improvement
client: Fixed a bug where JSON formatted logs would not show the requested and overlapping cores when failing to reserve cores
```

View File

@@ -85,7 +85,7 @@ func (p *partition) Reserve(cores *idset.Set[hw.CoreID]) error {
overlappingCores := p.reserve.Intersect(usableCores)
if overlappingCores.Size() > 0 {
// COMPAT: prior to Nomad 1.9.X this would silently happen, this should probably return an error instead
p.log.Warn("Unable to exclusively reserve the requested cores", "cores", cores, "overlapping_cores", overlappingCores)
p.log.Warn("Unable to exclusively reserve the requested cores", "cores", cores.Slice(), "overlapping_cores", overlappingCores.Slice())
}
p.share.RemoveSet(cores)