Branch: refs/heads/master
  Home:   https://github.com/jenkinsci/jenkins
  Commit: 89195cc248eb973dae4212d613914d616805bc1d
      
https://github.com/jenkinsci/jenkins/commit/89195cc248eb973dae4212d613914d616805bc1d
  Author: James Nord <jtn...@users.noreply.github.com>
  Date:   2024-03-06 (Wed, 06 Mar 2024)

  Changed paths:
    M core/src/main/java/hudson/model/Computer.java
    M core/src/test/java/hudson/model/ComputerTest.java

  Log Message:
  -----------
  [JENKINS-72796] stable context classloader for Computer.threadPoolForRemoting 
(#9012)

* [JENKINS-72796] stable context classloader for Computer.threadPoolForRemoting

Whilst the threadpool used reset the context classloader at the end of
any task, it did not ensure that the initial c;lassloader used was
anything sepcific, rather it would use whatever the calling threads
contextClassLoader was.

This is now fixed as we use the Jenkins WebApp classloader (same as
the Timer) which is used by (A)PeriodicTasks.

Whilst we should really not have a context classloader (aka null) and
this should be set where needed by code, almost everywhere in Jenkins
the context classloader is already the webapp classloader, and so
setting this to be different depending on how things where called would
seemingly be a little scary.  Arguably this and other context
classloaders should be all set to null and any code that wants different
should be changed, but this is a larger piece of work that would have
potential impact on an unknown number of plugins in the ecosystem, so
this fix uses what was set > 90% of the time.

* Update core/src/test/java/hudson/model/ComputerTest.java

---------

Co-authored-by: Tim Jacomb <21194782+ti...@users.noreply.github.com>



To unsubscribe from these emails, change your notification settings at 
https://github.com/jenkinsci/jenkins/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-commits+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-commits/jenkinsci/jenkins/push/refs/heads/master/b5c5ca-89195c%40github.com.

Reply via email to