-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Revert 58 to fix spotbugs/spotbugs!819 #100
Conversation
This reverts commit a0ceea6. It seems that this change introduced a multi-threading problem reported at spotbugs/spotbugs#819 so I revert that commit to make gradle plugin stable.
this is necessary because worker process needs them to run SpotBugs which depends on SLF4J.
@spotbugs/everyone could you review these changes? thank you! |
src/main/java/com/github/spotbugs/internal/spotbugs/SpotBugsExecuter.java
Outdated
Show resolved
Hide resolved
@@ -14,6 +14,7 @@ apply from: "$rootDir/gradle/deploy.gradle" | |||
version = '1.6.10-SNAPSHOT' | |||
group = "com.github.spotbugs" | |||
def spotBugsVersion = '3.1.11' | |||
def slf4jVersion = '1.8.0-beta2' |
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 think we need to seriously consider dropping SLF4J and just using JUL, for maximum compatibility.
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 you mean the trouble around gradle plugin, I think all the reported issues can be solved if we stop depending on Gradle internal API that excludes SLF4J from the dependency. This PR also solves a part of them by bumping up minimum supported version to 5.0. So I still think that SLF4J is better than that horrible JUL...
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.
+1 for JUL.. it just works.
Updated, please review this PR again @ThrawnCA |
Why revert using the worker API? Now you depend on internal APIs again, so your plugin could break at any time. Also, using a single request worker for every task will make your plugin much, much slower. Shouldn't instead the usage of static state be removed? |
I agree with @oehme; using Gradle internal APIs is a step backwards. If the spotbugs tool can not be quickly remedied to avoid preservation of static state, I suggest that we preserve the public API of |
I also believe that it's mandatory to remove dependency on Gradle internal API. This is why I made #104 recently. At the same time, we need to make this product working. The reverted code in this PR introduced a trouble. To make it stable asap, I merged this PR after the user test. Let's find the way to realize stable feature in both of feature and compatibility :) |
JavaExec mentioned by DPUkyle seems nice. It will be nice option to solve this issue. |
Maybe even a combination of worker api and javaExec could make sense. |
I must admit I haven't looked closely at the holistic issue, but what's problematic about dealing with the printout or dual registration at the point it happens? I don't see a dysfunction in the checkers where they themselves keep static state during analysis. |
The problem is the same why in 80% of the cases when you do an Or you analyze A and B with different version of the same plugin, and so on. |
@Vampire I totally agree with that assessment. What I'm meaning is that instead of printing a warning for every time a factory is re-registered, why not be pragmatic and warn only once? That doesn't hide the symptom, and it doesn't spam the logs, and you'll get the speedup associated with the worker API. For sure, there could be cases where your isolation is broken. Is that an issue that people are currently struggling with, or is it more of a theoretical problem at this point? |
What do you gain with speedup if you get wrong results? o_O Besides that, if he follows my suggestion to combine worker-api and javaExec, you are just a bit slower as you need to start a VM each time, but it will still be done in parallel. |
@Vampire If people actually do get wrong results, it's not a gain, agreed. In our projects we run the same extensions for SpotBugs for all (hundreds of) modules, so the execution time problem is much more important to solve. The speedup with the worker API and in daemon processing was substantial, reducing the execution time with more than 75%. That being said, we can perform tests with your proposed solution and see if it performs well enough. If it is at least 50% faster than the baseline I'd consider it a success from our point of view, otherwise not. |
It was not in-daemon with the worker API. |
You're right, I was under the wrong impression with how the worker API was used. I'd be happy to test the proposal, so we can know for sure. |
I'd like to add to what @davidburstromspotify said that the slowdown is a big deal for larger projects. We had to roll back to a prior version (1.6.9) of the plugin because it made such a huge difference in our in CI builds. |
Feel free to share your idea to solve this problem via PR! :) |
note: It is possible to launch SpotBugs by ExecResult result = project.javaexec(new Action<JavaExecSpec>() {
@Override
public void execute(JavaExecSpec javaSpec) {
javaSpec.args(spec.getArguments());
javaSpec.setMain("edu.umd.cs.findbugs.LaunchAppropriateUI");
}
}); To keep current feature, we need to avoid using |
This PR solves a reported problem at the core project.
To avoid potential issues, it also bumps up supported Gradle version from 4.0 to 5.0.