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

Disable recordCreateAt from RemoteClassLoader #258

Merged

Conversation

jglick
Copy link
Member

@jglick jglick commented Mar 6, 2018

While trying to diagnose poor performance of a plugin which did heavy remote class loading in a dev build, I saw agent thread dumps such as

"pool-…-thread-… for channel id=… / waiting for channel id=…" … RUNNABLE
	at java.lang.Throwable.getStackTraceElement(Native Method)
	at java.lang.Throwable.getOurStackTrace(Throwable.java:827)
	-  locked hudson.remoting.Command$Source@…
	at java.lang.Throwable.writeObject(Throwable.java:979)
	-  locked hudson.remoting.Command$Source@…
	at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1128)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
	at hudson.remoting.Command.writeTo(Command.java:106)
	at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.write(AbstractSynchronousByteArrayCommandTransport.java:46)
	at hudson.remoting.Channel.send(Channel.java:719)
	-  locked hudson.remoting.Channel@…
	at hudson.remoting.Request.call(Request.java:155)
	-  locked hudson.remoting.RemoteInvocationHandler$RPCRequest@…
	-  locked hudson.remoting.Channel@…
	at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:281)
	at com.sun.proxy.$Proxy5.fetch3(Unknown Source)
	at hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:209)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	-  locked hudson.remoting.RemoteClassLoader@…
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at …

While it might theoretically be interesting to diagnose where these commands are being created from, there are a lot of these little calls, and the overhead of constructing a stack trace and passing it through the channel each time seems excessive.

@reviewbybees

@oleg-nenashev oleg-nenashev requested a review from a user March 6, 2018 19:37
@jglick
Copy link
Member Author

jglick commented Mar 6, 2018

Using jenkinsci/support-core-plugin#128, before:

  • Writes: 2116
    • sent 5.3Mb
  • Reads: 3977
    • received 16.6Mb
  • Unexport: 1942
    • received 8.2Mb
  • RPCRequest:hudson.remoting.RemoteClassLoader$IClassLoader.fetch3[java.lang.String]: 1948
    • received 7.9Mb

After:

  • Writes: 2092
    • sent 5.1Mb
  • Reads: 3972
    • received 4.4Mb
  • Unexport: 1940
    • received 2.9Mb
  • RPCRequest:hudson.remoting.RemoteClassLoader$IClassLoader.fetch3[java.lang.String]: 1945
    • received 1.2Mb

In other words a 73% drop in the quantity of traffic received in this example.

@ghost ghost merged commit b40919a into jenkinsci:master Mar 8, 2018
@jglick jglick deleted the RemoteClassLoader-disable-recordCreatedAt branch March 9, 2018 19:36
@jglick
Copy link
Member Author

jglick commented Mar 9, 2018

Maybe deserves a changelog enttry?

@ghost
Copy link

ghost commented Mar 9, 2018

Yes, thanks. Missed it. PR inc

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant