Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul of SlaveLaunchLogs #517

Merged
merged 25 commits into from
Mar 18, 2024
Merged

Overhaul of SlaveLaunchLogs #517

merged 25 commits into from
Mar 18, 2024

Conversation

jglick
Copy link
Member

@jglick jglick commented Feb 29, 2024

The collection of launch logs from agents is rather antiquated given the prevalence of Clouds and is missing a lot of critical diagnostics. (CloudBees-internal reference: BEE-44099) Some observations:

SlaveLaunchLogs claims to include logs from ephemeral agents but does not. Perhaps it once did, but jenkinsci/jenkins#1681 broke this: SlaveComputer.kill deletes Computer.logDir when the computer is removed. (Despite the appearance in the executor widget, this does not happen merely because an agent is disconnected, so SlaveLaunchLogs will still include an entry for that agent while offline.) Not so easy to work around because this happens from Jenkins.updateComputerList, before NodeListener.fireOnDeleted is fired, and potentially before or concurrently with ComputerListener.onOffline.

SlaveLaunchLogs does not honor SafeTimerTask.getLogsRoot(). (This is set by CloudBees CI HA controllers.)

These issues can be solved in a straightforward way by just collecting all agent launch logs in one (rotated) log file, with every line prefixed by a timestamp and agent name. Downstream of jenkinsci/jenkins#9009 (without which the new system for log collection cannot work cannot work so easily for inbound agents).

Needs to be squash-merged since things went back and forth quite a bit here.

@jglick jglick added the bug label Feb 29, 2024
@jglick jglick requested a review from Vlatombe February 29, 2024 21:28
Copy link
Member

@Vlatombe Vlatombe left a comment

Choose a reason for hiding this comment

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

Recording review

@jglick jglick mentioned this pull request Mar 1, 2024
jglick added a commit to jglick/support-core-plugin that referenced this pull request Mar 1, 2024
@jglick jglick changed the title Overhaul of agent log collection Overhaul of SlaveLaunchLogs Mar 1, 2024
Comment on lines +154 to +155
out.write(DateTimeFormatter.ISO_INSTANT
.format(Instant.now().truncatedTo(ChronoUnit.MILLIS))
Copy link
Member Author

Choose a reason for hiding this comment

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

@jglick jglick marked this pull request as ready for review March 5, 2024 15:37
@jglick jglick requested a review from a team as a code owner March 5, 2024 15:37
@jglick jglick requested a review from Vlatombe March 18, 2024 13:20
@jglick jglick merged commit aef0621 into jenkinsci:master Mar 18, 2024
16 checks passed
@jglick jglick deleted the agent-logs branch March 18, 2024 14:57
@jglick jglick mentioned this pull request Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants