细节
描述
从2.264升级控制器后。我打开的第一个页面是/jenkins/configure(以检查是否有任何明显的表到div的回归)。必威国际有限公司
我注意到Docker Pipeline部分的一个错误,旁边是凭证选择器。
jenkins.log中的堆栈必威国际有限公司:
2021-06-02 08:57:17.369+0000 [id=570]警告o.e.j.s.h.contextthandler $Context#log:错误而提供http:/ /…/ 必威国际有限公司jenkins descriptorByName / org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint / fillCredentialsIdItemsjava.lang.LinkageError: loader(实例的hudson/ClassicPluginStrategy$AntClassLoader2):尝试重复类定义为名称:“com/cloudbees/plugins/credentials/CredentialsMatchers”. lang。类加载器. defineclass1(本机方法)类加载器.defineClass (类加载器. java: 756)在j必威国际有限公司enkins.util.AntClassLoader.defineClassFromData (AntClassLoader.java: 1155)美元hudson.ClassicPluginStrategy AntClassLoader2.defineClassFromData (ClassicPluginStrategy.java: 718) jenkins.util.AntClassLoader.getClassFromStream (AntClassLoader.java: 1326) jenkins.util.AntClassLoader.findClassInComponents (AntClassLoader.java: 1377) jenkins.util.AntClassLoader.findClass (AntClassLoader.java: 1342) jenkins.ClassLoaderReflectionToolkit._findClass (ClassLoaderReflectionToolkit.java: 107)$DependencyClassLoader.findClass(ClassicPluginStrategy.java:637)在java.lang。类加载器.loadClass (类加载器.java:418) at java.lang。类加载器.loadClass (类加载器.java:351) at 必威国际有限公司jenkins.util.AntClassLoader.findBaseClass(AntClassLoader.java:1406) at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1085) at java.lang。类加载器.loadClass (类加载器.java:351)在jen必威国际有限公司kins.authentication.token .api. authenticationtoken源.matcher(authenticationtoken源.java:89)在jenkins.authentication.token .api. authenticationtoken .matcher(authenticationtoken .java:87)在jenkins.authentication.token .api. authenticationtoken .matcher(authenticationtoken .java:72)在org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint$ descriptorimp.dofillcredentialsiditems (DockerRegistryEndpoint.java:375)在java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627) at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)原因:java.lang.reflect.InvocationTargetException
当重新加载页面时,同样的错误,带有截断的stacktrace(类加载器会记住该类的加载已经失败)。
2021-06-02 09:04:58.621+0000 [id=571]警告o.e.j.s.h.ContextHandler$Context#log:错误而提供http:/ /…/ 必威国际有限公司jenkins descriptorByName / org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint / fillCredentialsIdItemsjava.lang.LinkageError: loader(实例的hudson/ClassicPluginStrategy$AntClassLoader2):尝试重复类定义为名称:“com/cloudbees/plugins/credentials/CredentialsMatchers”在je必威国际有限公司nkins.authentication.tokens.api. authenticationtoken源.matcher(authenticationtoken源.java:89)在jenkins.authentication.token .api. authenticationtoken .matcher(authenticationtoken .java:87)在jenkins.authentication.token .api. authenticationtoken .matcher(authenticationtoken .java:72)在org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint$ descriptorimp.dofillcredentialsiditems (DockerRegistryEndpoint.java:375)在java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627) at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)原因:java.lang.reflect.InvocationTargetException
因此,看起来有几个线程导致加载CredentialsMatchers同时上课。实际上,这可能是因为从/jenkins/configure中可以有几个并发请必威国际有限公司求来填充一些凭证选择器:
...[02年/ 0200年6月/ 2021:10:57:17 +]“发布/ je必威国际有限公司nkins / descriptorByName / hudson.plugins.jira。JiraSite / fillCredentialsIdItems HTTP / 1.1”200 684“http:/ /…/ 必威国际有限公司jenkins /配置”“Mozilla / 5.0……”...[02年/ 0200年6月/ 2021:10:57:17 +]“POST /必威国际有限公司jenkins/descriptorByName/org. jenkin科学.plugins.docker.commons.credentials. dockerregistryendpoint /fillCredentialsIdItems HTTP/1.1”500 5431“http:/ /…/ 必威国际有限公司jenkins /配置”“Mozilla / 5.0……”
我已经(愚蠢地)重新启动了这个Jenkins控制器(它已经解决了问题),没有保留堆必威国际有限公司转储,所以我无法访问我们可能需要了解这个错误的所有信息。
但无论如何,沿着堆栈轨迹走,我认为我们可以(某种程度上)理解这种情况是如何发生的。
首先,有必威国际有限公司jenkins.util.AntClassLoader.loadClass (AntClassLoader.java: 1085)=>这是一个同步方法,但这本身并不会阻止其他线程通过不同的线程遵循相同的路径AntClassLoader实例(我假设这就是这里发生的情况)。
然后,我们到达一些父类加载器,据我所知,没有其他层的锁定/同步涉及。
这个帧可能是一个锁缺失的地方:
必威国际有限公司jenkins.ClassLoaderReflectionToolkit._findClass (ClassLoaderReflectionToolkit.java: 107)
这是有意的吗AntClassLoader.findClass(名字)是从同步块外部调用的吗?这是一个最近的变化从pr - 5110.我没有看到关于这个特定块的任何回顾评论,但是,(对我来说)为什么避免an的同步是可以的AntClassLoader.平蒂姆贾科姆而且杰西•格里克,来自PR-5110,关于这一点。
然后,还有一个看起来也有点滑稽的调用帧:
hudson.ClassicPluginStrategy DependencyClassLoader.findClass美元(ClassicPluginStrategy.java: 637)
类< ?> c = classloaderreflectiontoolkit . _findloaddclass (pw.)类加载器、名称);如果(c !=零)返回c;返回ClassLoaderReflectionToolkit._findClass (pw)。类加载器、名称);
这两个_findLoadedClass而且_findClass都是锁持有(好吧,并不是针对后者,请参见前面的观点),但是,由于锁在两个方法之间被释放,我们可以有两个线程,它们都通过第一个方法(依次),然后是后一个方法(依次)。我认为第二个线程将导致重复的类定义异常(一旦在findClass我看不出有什么能阻止它达到同样的地步,但也许我错过了一些东西)。也许ClassLoaderReflectionToolkit是否可以公开一个方法,该方法将在单个同步节下实现此逻辑?
附件
问题的链接
- 是由
-
必威国际有限公司詹金斯- 64864LinkageError加载器试图重复类定义
- Resolved
A developer had implemented a fix and is waiting for a feedback from the reporter.">解决
-
必威国际有限公司詹金斯- 65510试图重复类定义的名称:"com/cloudbees/plugins/credentials/CredentialsMatcher$CQL"
- Resolved
A developer had implemented a fix and is waiting for a feedback from the reporter.">解决
-
必威国际有限公司詹金斯- 651143.0.1版本的项目加载失败
- Closed
The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">关闭
- 涉及到
-
必威国际有限公司詹金斯- 46618[JDK9]来自jenkins核心的非法反射访问必威国际有限公司
- Closed
The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">关闭
-
必威国际有限公司詹金斯- 23784允许并行类加载
- In Progress
This issue is being actively worked on at the moment by the assignee.">在进行中
-
必威国际有限公司詹金斯- 65261没有出现警告趋势图;在ECharts API Plugin中重复ECharts - API .jar和ECharts -build-trends-2.0.0.jar中的类
- Resolved
A developer had implemented a fix and is waiting for a feedback from the reporter.">解决
- 链接
是否出现了从修正的回归
必威国际有限公司詹金斯- 46618.