Skip to content
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

Race condition in the dependencies of the osgiBundle task #75

Closed
lefou opened this issue Jul 7, 2022 · 16 comments
Closed

Race condition in the dependencies of the osgiBundle task #75

lefou opened this issue Jul 7, 2022 · 16 comments

Comments

@lefou
Copy link
Contributor

lefou commented Jul 7, 2022

The race is very well analyzed in this issue, so please read that issue completely.

The issue was introduces as part of this change

Some known documented occurence of this issue are

The applied workaround in these issues was to downgrade to sbt-osgi 0.9.4, but said version does not work with Java 17 and newer.

Here are some solutions:

  1. Fix the race. This requires very thorough understanding of sbt, which I lack
  2. Revert Use dependencies as JARs for force proper manifests (fixes #60) #64, which will result in less accurate generated manifests
  3. Introduce a new config setting to fine control how accurate we analyze dependencies to generate proper Import-Package statements. This is effectively a way to switch Use dependencies as JARs for force proper manifests (fixes #60) #64 on and off. We could default to off. Also, it should come with some documentation.
@mdedetrich
Copy link
Collaborator

@romainreuillon Should I assign you this issue? I noticed that you made some PR's on this topic so you seem to know the most about this problem

@romainreuillon
Copy link
Contributor

I think this PR: 65ad38f fixes this issue doesn't it?

Can you try @lefou?

@lefou
Copy link
Contributor Author

lefou commented Oct 24, 2023

I thought that too, but if I understood @mdedetrich correctly, sbt-osgi 0.9.8 (which contains the fix) does not work with Pekko, whereass the specially released sbt-osgi v0.9.4-INVALID-CEN-JAR-PATCH does.

@mdedetrich
Copy link
Collaborator

@romainreuillon I have already merged that PR and made a release of sbt-osgi (v0.9.8) and it didn't solve the issue (at least for Pekko)

@mdedetrich
Copy link
Collaborator

I thought that too, but if I understood @mdedetrich correctly, sbt-osgi 0.9.8 (which contains the fix) does not work with Pekko, whereass the specially released sbt-osgi v0.9.4-INVALID-CEN-JAR-PATCH does.

Maybe you can try and replicate it on your end, if it did end up solving the issue for you maybe we have multiple issues (and/or I didn't test correctly in which case I would do it again).

@lefou
Copy link
Contributor Author

lefou commented Oct 24, 2023

@mdedetrich Can you post the error and/or give a link the the build logs?

@mdedetrich
Copy link
Collaborator

The core issue is here apache/pekko#757 but the error I get is apache/pekko#745 (comment), i.e. there appears to be multiple classes in the produced jar's?

Let me know if I need to provide additional info

@lefou
Copy link
Contributor Author

lefou commented Oct 24, 2023

Thanks. As stated previously in the various Akka vs. OSGi tickets, I no longer have any sbt project that uses Akka and OSGi. I still have OSGi projects but I build them with Mill now, where this issues does not occur, as Mill has a more proper cache and output concept than sbt. I do not plan to work on these issue again, but I wanted to point out potential related issues as I felt kind-of responsible, as it was my PR that introduced the race condition. I'm happy that one is fixed. I now think the multiple classes issue in unrelated.

@lefou
Copy link
Contributor Author

lefou commented Oct 24, 2023

I think we can close this issue and assign it to version/milestone 0.9.8.

@lefou
Copy link
Contributor Author

lefou commented Oct 24, 2023

Maybe, it's a good idea to re-add the initial test case I added to #61, which then got reverted in #63 + #64, apparently due to the race condition.

@mdedetrich
Copy link
Collaborator

Okay, I will do a bit more digging and/or wait for @romainreuillon response (if he has one) to confirm that we are dealing with different separate issues or a rather a single one.

@mdedetrich
Copy link
Collaborator

Maybe, it's a good idea to re-add the initial test case I added to #61, which then got reverted in #63 + #64, apparently due to the race condition.

Ill get to this during the week

@romainreuillon
Copy link
Contributor

Indeed I have not encountered this kind of error message yet.

@mdedetrich
Copy link
Collaborator

Maybe, it's a good idea to re-add the initial test case I added to #61, which then got reverted in #63 + #64, apparently due to the race condition.

@lefou PR made at #97 and it passes

@mdedetrich
Copy link
Collaborator

@lefou @romainreuillon So shall I close this issue since its been confirmed that the problem Pekko is experiencing specifically is another issue and this issue is actually solved?

@lefou
Copy link
Contributor Author

lefou commented Nov 5, 2023

@mdedetrich Yeah, this issue is fixed now. Thank you for re-adding the tests.

@lefou lefou closed this as completed Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants