-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
[JENKINS-51818] Add JNLP port availability check #275
Conversation
if (e instanceof SocketTimeoutException) { | ||
reason = "timeout while attempting to reach node " + hostname + " on port " + port; | ||
} | ||
} finally { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it makes sense to suppress other exceptions (runtime&Co)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It make sense.
@denami Would it be possible to create a JIRA ticket for this defect? |
Yes. JIRA ticket created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i correctly remember the worst case when connection is dropped and waits infinitely on first host behind balancer that ends with infinite timeout and unability to connect slave. Workaround was to TCP reject port incoming packets on firewal.
s = new Socket(); | ||
s.setReuseAddress(true); | ||
SocketAddress sa = new InetSocketAddress(hostname, port); | ||
s.connect(sa, timeout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably `setSoTimeout()' for safety should be also defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
connect() method also has simple check for timeout value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
connect timeout != readtimeout , there is no read here, but just in case something will try to read from stream it may stuck operation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case we read nothing from socket. I think it is not necessary.
@oleg-nenashev Is any restriction for merge this pull request? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @dwnusbaum @jeffret-b any concerns?
Release ETA: tomorrow |
After updating from java 8 to java 11 getting the below error:- Exception in thread "main" java.lang.IllegalArgumentException: object is not an instance of declaring class at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at hudson.remoting.Launcher.addClasspath(Launcher.java:129) On analysing the remoting source code found that the hudson.remoting.Launcher.addClasspath invokes URLClassLoader and passes the instance using ClassLoader.getSystemClassLoader(). However in java 11, this seems like an illegal operation as ClassLoader.getSystemClassLoader() does not get the instance of URLClassLoader due to which we are getting the error "object is not an instance of declaring class". To fix this issue what updated the addClasspath method to invoke the URLClassLoader using a new instance of the class. Reference:- GitIssues:-jenkinsci#274,jenkinsci#275
In same configuration of balancer or firewall Jenkins HTTP/HTTPS port available for slave, but JNLP port is not visible for slave.