Max Spring discovered a stack overflow in http://jenkins.361315.n4.nabble.com/channel-example-and-plugin-classes-gives-ClassNotFoundException-td3756092.html that pointed this call into thread context classloader (TCL) as the culprit. Independently, Paul Sandoz discovered the same issue in our products. If TCL is another classloader that delegates to UberClassLoader (UCL), this code causes infinite recursion.
And moreover, given the goal of UCL, it seems wrong that this class is changing behaviour based on contextual information like TCL.
In looking at 4de81f1eb3, the change was introduced to make sure XStream unmarshalling invoked from Plugin.start() would see the classes in that plugin. This was an issue back then when plugins are prepared and loaded one by one, as UCL didn't have visibility into plugins being prepared. But in the current Jenkins, classloaders for all the plugins are prepared, before any plugin gets started, so by the time Plugin.start() runs, UCL is fully functioning.
Therefore, there's no need to consult TCL for the purpose of resolving its own classes. I could have also removed the code that sets TCL, but because some libraries often depend on TCL and doesn't properly look at caller class, I'm leaving it in, even though it's generally a bad practice to rely on TCL in multi-classloader apps like Jenkins
--------
Merged revisions 32975,33588,33697,34342 via svnmerge from
https://www.dev.java.net/svn/hudson/branches/downgrade
........
r32975 | kohsuke | 2010-07-16 21:27:59 +0200 (Fri, 16 Jul 2010) | 1 line
committed my partially modified version
........
r33588 | dienomight | 2010-08-05 09:42:36 +0200 (Thu, 05 Aug 2010) | 13 lines
Added getBackupVersion (UpdateCenter)
downgrade button now shows version of backup war file
Added HudsonDowngradeJob (UpdateCenter)
downgrading process is works now as HudsonUpgradeJob
Changed rewriteHudsonWar (Lifecycle)
backup file is deleted when downgrading
hudson/model/Hudson/downgrade_success.jelly is no longer necessary
Changed rewriteHudsonWar(WindowsServiceLifecycle)
hudson run as windows service creates backup during upgrading
........
r33697 | dienomight | 2010-08-11 17:09:48 +0200 (Wed, 11 Aug 2010) | 8 lines
committed changes:
"plugins downgrade functionality"
added:
* PluginDowngradeJob in UpdateCenter
* getCanDowngrade & getBackupPath & getBackupVersion in PluginWrapper
* additional "previous version" column in installed.jelly (PluginManager) with downgrade button (when it's possible to downgrade)
* doDowngrade in PluginManager
* deployBackup in UpdateSite
........
r34342 | dienomight | 2010-09-03 09:52:13 +0200 (Fri, 03 Sep 2010) | 12 lines
Code improvements:
jelly files:
*I put text inside ${%} so it would be available for translation.
UpdateCenter:
*changed getCanDowngrade to isDowngradable
*getBackupVersion use JarFile class to get version of .war backup
PluginWrapper:
*changed getBackupPath to getBackupFile
*getBackupVersion use JarFile class to get version of plugin backup
PluginManager:
*changed condition in doDowngrade method
........
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@34543 71c3de6d-444a-0410-be80-ed276b4c234a
- click category heading on Available tab to show/hide plugins in that category
- add initial sort for plugins on Installed tab
- no mouseover bgcolor for Advanced tab
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@31819 71c3de6d-444a-0410-be80-ed276b4c234a
https://www.dev.java.net/svn/hudson/branches/managed-startup
........
r23666 | kohsuke | 2009-11-11 15:56:46 -0800 (Wed, 11 Nov 2009) | 1 line
Reworked the initialization logic
........
r23667 | kohsuke | 2009-11-11 16:01:56 -0800 (Wed, 11 Nov 2009) | 1 line
fixed a failing test
........
r23670 | kohsuke | 2009-11-11 16:42:32 -0800 (Wed, 11 Nov 2009) | 1 line
use a non-snapshot
........
r23711 | kohsuke | 2009-11-13 14:27:28 -0800 (Fri, 13 Nov 2009) | 1 line
Session -> Reactor
........
r23782 | kohsuke | 2009-11-17 10:35:14 -0800 (Tue, 17 Nov 2009) | 1 line
Poorman's clone of JDK6 ServiceLoader.
........
r23783 | kohsuke | 2009-11-17 10:56:25 -0800 (Tue, 17 Nov 2009) | 1 line
Integrated the fatal support so that all errors are sent to the listener.
........
r23784 | kohsuke | 2009-11-17 10:58:07 -0800 (Tue, 17 Nov 2009) | 1 line
with the new reactor initialization, things are getting too verbose
........
r23785 | kohsuke | 2009-11-17 11:18:45 -0800 (Tue, 17 Nov 2009) | 1 line
failing to load jobs are non-fatal, too
........
r23788 | kohsuke | 2009-11-17 13:18:59 -0800 (Tue, 17 Nov 2009) | 1 line
logging the exception properly
........
r23809 | kohsuke | 2009-11-17 18:45:47 -0800 (Tue, 17 Nov 2009) | 1 line
releasing 1.1 as milestone
........
r23810 | kohsuke | 2009-11-17 18:47:37 -0800 (Tue, 17 Nov 2009) | 2 lines
- use a better idiom for building a sequence
- use null display name to signify internal book-keeping tasks that's not worth displaying
........
r23817 | kohsuke | 2009-11-18 07:54:17 -0800 (Wed, 18 Nov 2009) | 1 line
removed accidental JDK6 dependency.
........
r23859 | kohsuke | 2009-11-19 11:03:28 -0800 (Thu, 19 Nov 2009) | 1 line
introducing the strategy pattern to hook into key decision making points during the start up
........
r23870 | kohsuke | 2009-11-19 14:33:07 -0800 (Thu, 19 Nov 2009) | 1 line
bug fix. These steps add additional tasks to the reactor, so they need to also prevent future milestones from getting attained.
........
r23879 | kohsuke | 2009-11-19 16:54:59 -0800 (Thu, 19 Nov 2009) | 1 line
moved the logic to the strategy.
........
r23899 | kohsuke | 2009-11-20 09:32:13 -0800 (Fri, 20 Nov 2009) | 1 line
handle duplicate plugins better
........
r23900 | kohsuke | 2009-11-20 10:06:42 -0800 (Fri, 20 Nov 2009) | 1 line
support pre-exploded plugin
........
r23901 | kohsuke | 2009-11-20 10:49:04 -0800 (Fri, 20 Nov 2009) | 1 line
making it a subtype
........
r23902 | kohsuke | 2009-11-20 10:54:42 -0800 (Fri, 20 Nov 2009) | 1 line
allow InitStrategy to skip some tasks
........
r23903 | kohsuke | 2009-11-20 11:03:38 -0800 (Fri, 20 Nov 2009) | 1 line
doc improvement.
........
r23904 | kohsuke | 2009-11-20 11:03:49 -0800 (Fri, 20 Nov 2009) | 1 line
no need to throw exceptions
........
r23906 | kohsuke | 2009-11-20 11:17:34 -0800 (Fri, 20 Nov 2009) | 1 line
debug switch to disable the automatic launch of slaves
........
r23907 | kohsuke | 2009-11-20 11:25:15 -0800 (Fri, 20 Nov 2009) | 1 line
added a magic object for cancelling all saves
........
r23909 | kohsuke | 2009-11-20 11:29:53 -0800 (Fri, 20 Nov 2009) | 1 line
moving initialization up
........
r23913 | kohsuke | 2009-11-20 13:32:08 -0800 (Fri, 20 Nov 2009) | 1 line
seeing heap space problem during tests
........
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23992 71c3de6d-444a-0410-be80-ed276b4c234a
https://www.dev.java.net/svn/hudson/branches/multiple-update-sources
........
r23183 | abayer | 2009-10-25 11:53:17 -0700 (Sun, 25 Oct 2009) | 1 line
First chunk of work towards supporting multiple update centers - infrastructure in place for it, and default update center treated as only one of multiple - have to use slightly modified update-center.json though
........
r23185 | abayer | 2009-10-25 12:25:49 -0700 (Sun, 25 Oct 2009) | 1 line
a number of tweaks - among other things, now works properly with additional update centers defined in hudson.model.UpdateCenter.xml - try using http://andrewbayer.com/images/hello-world/helloWorld-update-center.json as second update center
........
r23245 | abayer | 2009-10-27 13:45:25 -0700 (Tue, 27 Oct 2009) | 1 line
Modified to support existing default update-center.json
........
r23256 | kohsuke | 2009-10-27 18:30:15 -0700 (Tue, 27 Oct 2009) | 7 lines
- moved data binding of update-center.json to UpdateSource.
- moved some of the UpdateSource property into JSON, to improve the user experience when adding an update source.
the user should just type in one URL, and everything else should happen automatically.
- it doesn't make sense for UpdateSource to rely on UpdateCenterConfiguration, since behaviors cannot be
modified per UpdateSource basis. Instead, leaving it in UpdateCenter allows us to maintain backward compatible
behaviors with the existing custom UpdateCenterConfiguration implementation.
........
r23266 | kohsuke | 2009-10-27 19:29:24 -0700 (Tue, 27 Oct 2009) | 1 line
serve id inside JSON.
........
r23279 | kohsuke | 2009-10-28 10:44:00 -0700 (Wed, 28 Oct 2009) | 1 line
Do not special-case "default" ID. Receive hudson.war updates from wherever that provides one.
........
r23280 | kohsuke | 2009-10-28 10:50:57 -0700 (Wed, 28 Oct 2009) | 1 line
formatting change.
........
r23281 | kohsuke | 2009-10-28 11:30:40 -0700 (Wed, 28 Oct 2009) | 1 line
typo
........
r23282 | kohsuke | 2009-10-28 11:45:06 -0700 (Wed, 28 Oct 2009) | 2 lines
- added the UI to remove sites.
- persistence of UpdateSource happens more automatically now.
........
r23283 | kohsuke | 2009-10-28 11:50:04 -0700 (Wed, 28 Oct 2009) | 1 line
UpdateSource -> UpdateSite to align terminology with Eclipse.
........
r23284 | kohsuke | 2009-10-28 11:55:03 -0700 (Wed, 28 Oct 2009) | 5 lines
Actually, for now, just having a programmatic modification to UpdateSite would satisfy the primary use case.
And I'd like to upgrade YUI to a more recent version so that we can use its DataTable for UI. Plus the single update center model encourages the community to bring the code into the Hudson project, which is something we'd like to keep.
So all in all, I'm postponing the UI work.
........
r23286 | kohsuke | 2009-10-28 13:07:19 -0700 (Wed, 28 Oct 2009) | 1 line
Renaming and bug fixes.
........
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23326 71c3de6d-444a-0410-be80-ed276b4c234a
https://www.dev.java.net/svn/hudson/branches/HUDSON-3251
........
r16689 | kohsuke | 2009-03-29 08:52:25 -0700 (Sun, 29 Mar 2009) | 1 line
[HUDSON-3251] (1/18) moving maven-related source to maven-plugin
........
r16690 | kohsuke | 2009-03-29 08:57:23 -0700 (Sun, 29 Mar 2009) | 4 lines
[HUDSON-3251] (3/18) moved KeptBecauseOfParent message
Note I skipped (2/18) to move the logic into MavenProject.DescriptorImpl.isApplicable.
........
r16691 | kohsuke | 2009-03-29 08:58:21 -0700 (Sun, 29 Mar 2009) | 3 lines
[HUDSON-3251] (4/18) removed imports and javadoc links to Maven-related classes
........
r16692 | kohsuke | 2009-03-29 08:59:49 -0700 (Sun, 29 Mar 2009) | 2 lines
[HUDSON-3251] (5/18) moving maven-related functionality to maven plugin.
........
r16693 | kohsuke | 2009-03-29 09:01:11 -0700 (Sun, 29 Mar 2009) | 5 lines
[HUDSON-3251] (5/18) moving maven-related functionality to maven plugin
Forgot to add a newly created file.
........
r16694 | kohsuke | 2009-03-29 09:02:24 -0700 (Sun, 29 Mar 2009) | 1 line
needs a copyright header on all files in the core
........
r16695 | kohsuke | 2009-03-29 09:07:03 -0700 (Sun, 29 Mar 2009) | 1 line
[HUDSON-3251] (6/18) updating poms and packaging to bundle maven plugin (with a minor adjustment to revert forkMode change)
........
r16696 | kohsuke | 2009-03-29 09:17:58 -0700 (Sun, 29 Mar 2009) | 1 line
[HUDSON-3251] (6/18) updating poms and packaging to bundle maven plugin (with a minor adjustment to revert forkMode change)
........
r16697 | kohsuke | 2009-03-29 09:38:23 -0700 (Sun, 29 Mar 2009) | 2 lines
[HUDSON-3251] (7/18) add a hudson.bundled.plugins property that can override the default bundled plugins.
........
r16701 | kohsuke | 2009-03-29 15:14:38 -0700 (Sun, 29 Mar 2009) | 1 line
[HUDSON-3251] (8/18) finding Maven jars through reflection for now. TODO: introduce a post-initialization hook
........
r16702 | kohsuke | 2009-03-29 15:20:36 -0700 (Sun, 29 Mar 2009) | 2 lines
[HUDSON-3251] (10/18) use lastModified to avoid unpacking bundled plugins unnecessarily.
........
r16703 | kohsuke | 2009-03-29 15:21:15 -0700 (Sun, 29 Mar 2009) | 1 line
[HUDSON-3251] (12/18) updating poms and packaging to bundle maven plugin
........
r16704 | kohsuke | 2009-03-29 15:37:32 -0700 (Sun, 29 Mar 2009) | 1 line
[HUDSON-3251] (15/18) resolve plugins from the classpath in tests. Slightly reworked.
........
r16705 | kohsuke | 2009-03-29 15:38:12 -0700 (Sun, 29 Mar 2009) | 1 line
[HUDSON-3251] (16/18) update hpi plugin version
........
r16706 | kohsuke | 2009-03-29 15:38:54 -0700 (Sun, 29 Mar 2009) | 1 line
[HUDSON-3251] (17/18) moved createExecutedMojoCache
........
r16707 | kohsuke | 2009-03-29 15:42:38 -0700 (Sun, 29 Mar 2009) | 3 lines
[HUDSON-3251] after looking at (18/18), I think the same effect can be achieved more easily by not setting this system property at all.
Or am I missing something?
........
r16708 | kohsuke | 2009-03-29 15:43:30 -0700 (Sun, 29 Mar 2009) | 1 line
formatting change
........
r16709 | kohsuke | 2009-03-29 15:58:16 -0700 (Sun, 29 Mar 2009) | 1 line
[HUDSON-3251] ignore certain builders and publishers in Maven2 job type. This does the same thing as (2/18) in Tom's patch, but I believe this is better. Still needs to figure out how to do this for MavenModule, which doesn't have a descriptor.
........
r16710 | kohsuke | 2009-03-29 16:01:00 -0700 (Sun, 29 Mar 2009) | 1 line
ignore generated files
........
r16712 | kohsuke | 2009-03-29 16:29:05 -0700 (Sun, 29 Mar 2009) | 3 lines
[HUDSON-3251] revisited patch (8/18). ComputerListener is extended to support the preOnline step, so that some operations can be carried out whose failure will result in the node failing to become online.
Maven-plugin uses this now to avoid the use of reflection.
........
r16713 | kohsuke | 2009-03-29 16:38:48 -0700 (Sun, 29 Mar 2009) | 1 line
switching to fork because otherwise the test fails with PermGen out of space
........
r16714 | kohsuke | 2009-03-29 16:39:36 -0700 (Sun, 29 Mar 2009) | 1 line
no, the next version is 1.295.
........
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16734 71c3de6d-444a-0410-be80-ed276b4c234a