Skip to content

client: Fixed a bug where JSON formatted logs would not show the requested and overlapping cores when failing to reserve cores#25523

Merged
tgross merged 1 commit intohashicorp:mainfrom
mvegter:fix-logging-of-overlapping-cpuset
Mar 27, 2025
Merged

client: Fixed a bug where JSON formatted logs would not show the requested and overlapping cores when failing to reserve cores#25523
tgross merged 1 commit intohashicorp:mainfrom
mvegter:fix-logging-of-overlapping-cpuset

Conversation

@mvegter
Copy link
Copy Markdown
Contributor

@mvegter mvegter commented Mar 26, 2025

Description

There is a difference between the json and non-json logger resulting in the loss of data.

Testing & Reproduction steps

{
  "@level": "warn",
  "@message": "Unable to exclusively reserve the requested cores",
  "@timestamp": "2025-03-26T14:37:04.459938+01:00",
  "cores": {},
  "overlapping_cores": {}
}

versus

{
  "@level": "warn",
  "@message": "Unable to exclusively reserve the requested cores",
  "@timestamp": "2025-03-26T14:39:03.441068+01:00",
  "cores": [
    1,
    2,
    3
  ],
  "overlapping_cores": [
    3
  ]
}

Links

This was originally introduced by !24304

Contributor Checklist

  • Changelog Entry If this PR changes user-facing behavior, please generate and add a
    changelog entry using the make cl command.
  • Testing Please add tests to cover any new functionality or to demonstrate bug fixes and
    ensure regressions will be caught.
  • Documentation If the change impacts user-facing functionality such as the CLI, API, UI,
    and job configuration, please update the Nomad website documentation to reflect this. Refer to
    the website README for docs guidelines. Please also consider whether the
    change requires notes within the upgrade guide.

Reviewer Checklist

  • Backport Labels Please add the correct backport labels as described by the internal
    backporting document.
  • Commit Type Ensure the correct merge method is selected which should be "squash and merge"
    in the majority of situations. The main exceptions are long-lived feature branches or merges where
    history should be preserved.
  • Enterprise PRs If this is an enterprise only PR, please add any required changelog entry
    within the public repository.

Copy link
Copy Markdown
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mvegter! This looks great once we tweak the changelog a bit.

Comment thread .changelog/25523.txt Outdated
@tgross tgross moved this from Needs Triage to Triaging in Nomad - Community Issues Triage Mar 26, 2025
@tgross tgross self-assigned this Mar 26, 2025
@tgross tgross moved this from Triaging to In Progress in Nomad - Community Issues Triage Mar 26, 2025
…ested and overlapping cores when failing to reserve cores
@mvegter
Copy link
Copy Markdown
Contributor Author

mvegter commented Mar 27, 2025

Thanks @tgross , for others to reference, the difference is between stdout and json logger : https://github.com/hashicorp/go-hclog/blob/v1.6.3/intlogger.go#L419-L426 versus https://github.com/hashicorp/go-hclog/blob/v1.6.3/intlogger.go#L645 , where the "%v" will result in the call to Set#String() on stdout versus the JSON encoding not being able to fully encode the value of the custom wrapper interface.

@mvegter mvegter changed the title scheduler: log the items Slice instead of the idset to properly log this in JSON client: Fixed a bug where JSON formatted logs would not show the requested and overlapping cores when failing to reserve cores Mar 27, 2025
@tgross tgross merged commit 736103a into hashicorp:main Mar 27, 2025
22 of 23 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Nomad - Community Issues Triage Mar 27, 2025
@github-actions
Copy link
Copy Markdown

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

Development

Successfully merging this pull request may close these issues.

2 participants