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

Broaden the scope of Thread.name inclusion to whole Request.call body #374

Merged
merged 1 commit into from
Apr 20, 2020

Conversation

jglick
Copy link
Member

@jglick jglick commented Apr 6, 2020

Looking at a thread dump, saw something like

"SupportPlugin periodic bundle generator: writing ….zip since …" …
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for <…> (a java.util.concurrent.FutureTask)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:429)
	at java.util.concurrent.FutureTask.get(FutureTask.java:191)
	at hudson.remoting.Request.call(Request.java:188)
	- locked <…> (a hudson.remoting.UserRequest)
	at hudson.remoting.Channel.call(Channel.java:956)
	at hudson.FilePath.act(FilePath.java:1070)
	at hudson.FilePath.act(FilePath.java:1059)
	at hudson.FilePath.copyTo(FilePath.java:2234)
	at com.cloudbees.jenkins.support.api.FilePathContent.writeTo(FilePathContent.java:63)
	at com.cloudbees.jenkins.support.SupportPlugin.writeBundle(SupportPlugin.java:316)
	at com.cloudbees.jenkins.support.SupportPlugin.writeBundle(SupportPlugin.java:278)
	at com.cloudbees.jenkins.support.SupportPlugin$PeriodicWorkImpl.lambda$doRun$0(SupportPlugin.java:820)
	at com.cloudbees.jenkins.support.SupportPlugin$PeriodicWorkImpl$$Lambda$….run(Unknown Source)

It is unclear which agent is being waited for in this case. Request.call had helpfully been setting a Thread.name but this covered

but not for example in this case.

@jglick jglick added the enhancement For changelog: An enhancement providing new capability. label Apr 6, 2020
Thread t = Thread.currentThread();
String name = t.getName();
try {
t.setName(name + " / waiting for " + channel.getName() + " id=" + id);
checkIfCanBeExecutedOnChannel(channel);
Copy link
Member Author

Choose a reason for hiding this comment

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

Preserving indentation of unmodified lines to minimize diff.

@jglick jglick requested a review from jeffret-b April 6, 2020 16:40
Copy link
Contributor

@jeffret-b jeffret-b left a comment

Choose a reason for hiding this comment

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

Looks good. It help us locate additional information in some cases.

I'd be in favor of fixing the indentation to be correct.

@jeffret-b jeffret-b requested a review from jvz April 6, 2020 16:56
@jeffret-b jeffret-b merged commit 0ee56f4 into jenkinsci:master Apr 20, 2020
@jglick jglick deleted the Request.call-Thread.name branch April 20, 2020 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For changelog: An enhancement providing new capability. ready-to-merge
Projects
None yet
5 participants