-
Couldn't load subscription status.
- Fork 140
[MRESOLVER-131] Introduce a Redisson-based SyncContextFactory #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
Conversation
|
@dantran Please try this on your huge multimodule project. This should perform way better than global locking. |
|
On unix, redis default configuration could be with Unix socket? It will be more |
|
@philippe-granet While you are correct, of course. I can't provide it. Please read: redisson/redisson#773 (comment). Redisson's code has been stupidly nailed to |
|
I think you can activate an unix socket if servers binded to loopback interface (127.0.0.1 ?). It requires netty-transport-native-epoll lib in classpath. See Config.setTransportMode and https://github.com/redisson/redisson/blob/master/redisson/src/main/java/org/redisson/config/TransportMode.java |
|
This will not and cannot work. You need to provide the bind address of the Unix socket. Read the Redisson code. |
|
@michael-o I built your branch (1.5.1-SNAPSHOT), and replace it at my maven 3.6.3( build from source via mvn clean install -DresolverVersion=1.5.1-SNAPSHOT -Drat.skip=true). The result is better but still slow The serialization of dependencies is the culprit |
|
@dantran Thank you very much for testing. I assume that your project is not publically available. I will try to make some assumptions if you cannot share the trace logs:
There could be two explanations:
Do you think you could provide an obfuscated log? I'd like to see what is causing the delay. Here is the log config. |
|
If somebody has a large OSS project at hand, let me know. I tried Payara and Windup. The overhead was very humble: 10%. |
|
@dantran Can you please retry by increasing |
|
@michael-o I gave this a another try with
struggling to see any redis/netty logging showing up at console. So my build is not using Redis at all. Still looking ... |
|
@dantran Then something hasn't been picked up. Please verify that everything required from |
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.
Very interesting work.
Are you able to add some test case?
...ontext-redisson/src/main/java/org/eclipse/aether/synccontext/RedissonSyncContextFactory.java
Show resolved
Hide resolved
I have though about this, but two points are crucial here and was not able to properly solve them:
|
|
Oh there is no Redis server emulator for Java. Btw I was also thinking about a simple smoke tests that connects to Redis and covers the code, this way we can see that at least it is working in a simple scenario. |
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
I'll need to think about this, but provide in a subsequent PR. Already put a week of work into it. |
|
@michael-o i gave maven 3.7 a try to with MRESOVER-131, still dont see traces of redis. Can I assume that since I run my Redis docker locally, there is no need for me to configure the yml settings from your instructions page? |
Yes, as long as you have mapped the port from the container to your local machine and Redis is availabe through
Please provide: and lauch with |
|
@michael-o Thanks for your great work! Do you think that can be used as implementation of |
|
@philippe-granet I need to look at them. @cstamas and me tried with a file-based one and ditched it because it wasn't working. I know that Lucene's code is very very nice. If someone can profile a PR which works or various locally hosted FS systems I would love to evaluate and include. For the time being, I will not work on that because the Redis alternative is extremely easy to set up. |
|
@michael-o I'm not sure where to report this but I'm struggling to make this work, my use case is to properly support concurrent build on jenkins for many projects, we often run into some concurrency problems with sharing the m2 repo across multiple jobs. I'm using this dockerfile to generate a maven docker image for jenkins based of these instructions. Running a build with this and After, running the build with the debug flag will produce this output. Nothing related to connecting to redis. Output of tree $MAVEN_HOME I'm not sure what's wrong here, any ideas? |
|
You did not upgrade to Resolver 1.7.1 |
|
@michael-o Actually, I'm trying to upgrade from an old version of our custom maven jenkins image that was working and I'm running into this issue. The previous configuration of our image is this. Basically, the difference is that we were using the version I tried to include a dependency to |
|
The Redisson-based approach between 1.6 and 1.7 is, unfortunately, not compatible. It has been competely moved to the named lock approach. I highly recommend to replace 1.6.x completely 1.7.x. If you need to stick to 1.6.x, follow this guide. This cannot and will not work with 1.6.x. |
|
@michael-o Oh OK good to know between 1.6.x and 1.7.x. I have it running with 1.6.x and it works great for our use case(thx for that!), I was just trying to upgrade and ran into those problems. From what I can see, in a vanilla maven 3.8.1 install, the $MAVEN_HOME/lib contains the 1.6.2 version of Thanks again for your help! |
|
Maven 3.8.x comes with Resolver 1.6.x because Resolver 1.7 requires Java 8 which Maven 3.8.x cannot offer. You can create a custom Maven distro to upgrade Resolver. See apache/maven@fc806a2#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8 and you are good to go. Since you are the first user responding to use Redis for Resolver. Can you provide numbers of execution time compared to before? I.e., how does synchronization affect build times for you in percent? |
|
I would recomment to compare the |
|
Yea ok it finally makes sense. If I can suggest something, this should be in the documentation to warn others. Since the 1.7.x version is the current version, it's the documentation page you end up on on apache.org and there's no mention that it's not compatible with the current and latest version of maven. Getting the documentation for the 1.6.x version is impossible going through google at least. I can suggest a PR if you think it's worth it. As for build time, with mvn 3.8.1, redis resolver 1.6.3 and localhost redis, I have these times for a With an already populated .m2/repo (running a To me, it's a very much acceptable tradeoff to be able to run multiple builds in parallel in jenkins by sharing the same .m2 repo! |
|
I figured I'd educate myself so I built maven 3.8.1 with maven-resolver set to 1.7.0 and run the tests with populated .m2/repo preceded by a So it seems that the differences in my other post were most likely related to I/O speed fetching all the dependencies more than the overhead by redis locks. |
|
I have already noticed that documentation is weak. We were more focused on proper functionality. I also have founds bugs in Redisson with this new module. Please file an issue about the missing documentation. As far as I understand your numbers, if you'd have to use seperate local repos, you would have to add at least four minutes to each build? If so, that is fantastic. |
|
@michael-o Yup that's correct, reusing the same m2 repo for different builds cut the build time dramatically, that's exactly why I ended up using your plugin for secure multithreaded build on our CI :D I've logged https://issues.apache.org/jira/browse/MRESOLVER-188 for the documentation. |
That's perfect. Months of work worth going for. Can you also compare with
Will take care soon. |
|
I'll test it out tomorrow and come back to you. Thanks again |
|
with semaphores : 19.795s This is using my custom build mvn with redisson 3.15.6 and maven-resolver-named-locks-redisson-1.7.1. Again, negligible difference on my end. I've tried to make it a bit more interesting, I've cloned 4 times my repository and I built the project with the
I did run into an issue running these tests, I've opened https://issues.apache.org/jira/browse/MRESOLVER-189 about it. |
|
Resolve #870 |
1 similar comment
|
Resolve #870 |
This closes #68