Skip to content

Not thread safe file manipulation results in build failures of multi-module projects #107

@nikita2206

Description

@nikita2206

Maven Version

3.9.8

Version

0.0.8

Sentry SDK Version

7.14.0

Steps to Reproduce

  1. Have a multi-module Maven project
  2. Run mvn install -T1C (or higher concurrency)

This breaks non-deterministically

Expected Result

Sources are uploaded to Sentry

Actual Result

Getting an error

/bin/sh: 1: /tmp/.sentry-cli10465974399318709029.exe: Text file busy

As far as I understand it is coming from this line

escape(getCliPath(mavenProject, sentryCliExecutablePath))

Which is preceded by
final @NotNull File tempFile = File.createTempFile(".sentry-cli", ".exe");

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions