-
Notifications
You must be signed in to change notification settings - Fork 68
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
Make workflow-support compatible with Guava 21.0 and newer #114
Conversation
seriously -.-, old pinned version in Jenkinsfile... |
pom.xml
Outdated
@@ -64,11 +64,12 @@ | |||
<properties> | |||
<revision>3.8</revision> | |||
<changelist>-SNAPSHOT</changelist> | |||
<jenkins.version>2.222.4</jenkins.version> | |||
<jenkins.version>2.273-rc30689.09147672b85b</jenkins.version> |
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.
Can you please link to whatever Jenkins core PR produced this incremental so reviewers have more context about the proposed change? Thanks!
@@ -324,7 +324,7 @@ public void run() { | |||
public static <V> ListenableFuture<List<V>> allAsList( | |||
ListenableFuture<? extends V>... futures) { | |||
return new ListFuture<V>(ImmutableList.copyOf(futures), true, | |||
MoreExecutors.sameThreadExecutor()); | |||
MoreExecutors.newDirectExecutorService()); |
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.
Since this is since Guava 18, maybe we could use reflection to try newDirectExecutorService
then fall back to sameThreadExecutor
, then revert the core bump?
Or copy the impl into this plugin, keeping the Apache license header.
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.
nice idea, when I was working on it (and plan to get back to it, although others are welcome to take it up) I was trying to get a green bom PCT build and then look at what's required and see where changes like your suggestion could be applied.
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 have this change ready to push. Is it ok if I push to your branch @timja?
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.
absolutely go for 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.
also see jenkinsci/workflow-api-plugin#135 and jenkinsci/bom#423
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.
Errr, I don't have push permission here, so I've filed a PR to your forked branch: timja#1
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.
also see jenkinsci/workflow-api-plugin#135 and jenkinsci/bom#423
I'll have a look. Meanwhile, isn't this PR mergeable as is?
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.
looks good to me
src/main/java/org/jenkinsci/plugins/workflow/support/concurrent/Futures.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jenkinsci/plugins/workflow/support/concurrent/Futures.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Jesse Glick <jglick@cloudbees.com>
I updated the PR title and description to reflect the proposed change. |
src/main/java/org/jenkinsci/plugins/workflow/support/concurrent/Futures.java
Outdated
Show resolved
Hide resolved
@car-roll this will need a release too. (Or https://github.com/jenkinsci/incrementals-tools#automatic-deployment if you are sick of my bugging you about stuff like this 😁.) |
Not yet! 😁 But I should probably look into that stuff still... |
See jenkinsci/jenkins#5059.
workflow-support
previously usedMoreExecutors.sameThreadExecutor
from Guava, which was removed in version 21.0 in favor ofMoreExecutors.newDirectExecutorService
. This PR uses reflection to first try to callMoreExecutors.newDirectExecutorService
but then callMoreExecutors.sameThreadExecutor
if the first method is not available to support both older and newer versions of Guava.