From 736103aa5428ba5eb3b61a15f1d73ccc275959c3 Mon Sep 17 00:00:00 2001 From: Martijn Vegter Date: Thu, 27 Mar 2025 13:52:32 +0100 Subject: [PATCH] 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 --- .changelog/25523.txt | 3 +++ client/lib/cgroupslib/partition_linux.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changelog/25523.txt diff --git a/.changelog/25523.txt b/.changelog/25523.txt new file mode 100644 index 000000000..2734b8ba0 --- /dev/null +++ b/.changelog/25523.txt @@ -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 +``` diff --git a/client/lib/cgroupslib/partition_linux.go b/client/lib/cgroupslib/partition_linux.go index a3bfe294a..ff36c21b5 100644 --- a/client/lib/cgroupslib/partition_linux.go +++ b/client/lib/cgroupslib/partition_linux.go @@ -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)