-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Not thread safe file manipulation results in build failures of multi-module projects #107
Comments
Thanks for opening this issue. We haven't optimized the sentry-maven-plugin for parallel execution (yet). We could ensure only a single We could then synchronize I'm afraid merely retrying would only fix the problem in a few cases but not all of them and it'd just take longer to fail - not sure that's much better than the current behaviour. Or do I misunderstand the issue and it's only a problem right after We're gonna take a look at this in more detail but I can't give an ETA at this point, as we're currently working on v8 of the Java SDK. |
Thanks for your reply @adinauer This seems to be happening right after the file is copied, this happens only sometimes. Seems like the exact way to reproduce this is to create a file, mark it executable and then attempt to run it as a subprocess. Given this, it seemed like there's just no way around this bug given the File System features that JVM exposes/doesn't expose. One other option I'm considering is ignoring the failure in Maven, because being unable to upload sources isn't really a show stopper but only an inconvenience. |
With the above in mind @adinauer , what do you think about adding the following parameter, which is also part of a few other Maven plugins:
If you think it's acceptable for you guys, I can quickly open a PR. Otherwise, we are quite happy with how errors looks now in Sentry 🙌 |
That sounds good, only downside is probably that on a fail you have to upload the sources somehow. I'm not quite sure how that'd play out exactly. On a later upload you just need to make sure you use the same ID that's been packaged with the JAR as We can tackle that problem separately as I'm not sure how exactly we wanna solve it. A PR would be very welcome! Thanks for the feedback! |
Regarding the original problem here, maybe it's sufficient to just sleep for a bit and only then use the freshly copied file. |
Maven Version
3.9.8
Version
0.0.8
Sentry SDK Version
7.14.0
Steps to Reproduce
mvn install -T1C
(or higher concurrency)This breaks non-deterministically
Expected Result
Sources are uploaded to Sentry
Actual Result
Getting an error
As far as I understand it is coming from this line
sentry-maven-plugin/src/main/java/io/sentry/cli/SentryCliRunner.java
Line 75 in daa4fd9
Which is preceded by
sentry-maven-plugin/src/main/java/io/sentry/SentryCliProvider.java
Line 112 in daa4fd9
After reviewing how thread safe the implementation is, I couldn't pinpoint where the issue is.
Not having other ideas, it seems like the root cause may lie in the JVM bug: https://bugs.openjdk.org/browse/JDK-8068370
It is suggested that a retry could help with that issue. Would be happy to accept a PR that implements a single-attempt retry logic for this bit of code?
The text was updated successfully, but these errors were encountered: