-
-
Notifications
You must be signed in to change notification settings - Fork 272
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-37566] - FindBugs Cleanup. Part #1 #109
[JENKINS-37566] - FindBugs Cleanup. Part #1 #109
Conversation
…itializeJarCacheMain#copyFile
Now we use a more agressive check
…o.NioChannelHub$NioTransport.abort
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
Well, I've definitely broken something. Self-:bug: |
ObjectOutputStream oos = new ObjectOutputStream(Mode.TEXT.wrap(os)); | ||
oos.writeObject(this); | ||
oos.flush(); | ||
try (ObjectOutputStream oos = new ObjectOutputStream(Mode.TEXT.wrap(os))) { |
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.
So it causes the channel close since we also close upstream channels
…ign to be reworked
… RemoteInvocationHandler and UserRequest
now it's a timeout |
and some
|
@@ -23,6 +23,7 @@ | |||
*/ | |||
package hudson.remoting; | |||
|
|||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; | |||
import edu.umd.cs.findbugs.annotations.SuppressWarnings; |
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.
Get rid of the other SuppressWarnings import
@@ -291,7 +294,7 @@ | |||
/** | |||
* Property bag that contains application-specific stuff. | |||
*/ | |||
private final Hashtable<Object,Object> properties = new Hashtable<Object,Object>(); | |||
private final ConcurrentHashMap<Object,Object> properties = new ConcurrentHashMap<>(); |
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.
Could this be ConcurrentMap
as the declared type?
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.
It could, will change though there is no much difference since the field is private
@@ -271,10 +272,10 @@ public ChannelBuilder withProperty(Object key, Object value) { | |||
} | |||
|
|||
/** | |||
* @since TODO | |||
* @since 2.47 |
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.
I would document that the backing map may be subject to concurrent modifications or (better) provide a hint/reminder that the builder is not threadsafe
@@ -98,7 +103,7 @@ public void write(int c) throws IOException { | |||
write(new char[]{(char)c},0,1); | |||
} | |||
|
|||
public void write(char[] cbuf, int off, int len) throws IOException { | |||
public synchronized void write(char[] cbuf, int off, int len) throws IOException { |
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.
Are we sure this will not introduce risk of deadlock?
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 makes sense to reimplement it
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.
Mostly a few questions that need answering before approval
On DV@cloud some tests throw this (suppressed) exception. Not sure why. It is either related to the agent configuration, though it may be a regression after the migration to Java 7 Files API. Works on my machine
|
…alidPathException
@reviewbybees ready to the review, tests are green with the current CI setup |
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 (touch) jar.setLastModified(System.currentTimeMillis()); | ||
if (notified.add(new Checksum(sum1,sum2))) | ||
if (touch) { | ||
Files.setLastModifiedTime(jar.toPath(), FileTime.fromMillis(System.currentTimeMillis())); |
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 all this code needs to handle InvalidPathException before merging
Will fix |
Addresses 17 issues in the library, mostly related to File operations, concurrency and NITs. 34 issues are still need to be fixed.
@reviewbybees and @stephenc hence some issues come from his code