Comments (5)
To start off with, the fact you have had no problems running with multiple threads over x period of time does not mean that the plugin is thread safe, it just means you haven't got unlucky yet.
Making the code thread safe is rarely as simple as sticking a synchronised keyword in a few places, all you are doing is forcing the code to queue up multiple requests that will be executed in a single thread (In other words you are blocking the code from running in multiple threads).
To make the plugin thread safe we would need to do the following as a minimum:
- Check all dependencies are thread safe and change them/get their authors to make them threads safe and update them if they are not.
- Check all static member variables are using thread safe data types and change them if they are not.
- To ensure acceptable performance levels you should limit the use of synchronized and instead make the code smarter e.g. if multiple threads want to download a file, one thread should download it and then report to the other threads that it was downloaded successfully, you don't want to end up downloading the same file 5 times in sequence (Or in the case of your PR depending upon which call gets in next we may perform 2 downloads, then an unzip, then another download, then two more unzips, etc, etc).
- The plugin works with external files that are not part of the JVM, we should really be locking them from an os level before working on them (this would also protect you against two maven runs running in parallel in separate terminals).
It is possible to make the plugin thread safe, but it's going to take time, effort and require lots of testing.
Also please do bear in mind that what you are seeing in your maven console is simply a warning, if everything works fine for you, you can just disregard it; it is a warning after all.
from driver-binary-downloader-maven-plugin.
The plugin is not thread safe. It uses a static download location, and it extracts binaries to a single location, if multiple instances of the plugin try to download/extract at the same time you could end up with corrupted downloads/binaries.
from driver-binary-downloader-maven-plugin.
@Ardesco I reviewed the mentioned parts and added synchronized blocks.
We are already running the plugin for multiple month with mvn -T1C and it works without problems.
Is there anything else that I have to do?
from driver-binary-downloader-maven-plugin.
This may be worth reviewing: https://cwiki.apache.org/confluence/display/MAVEN/Parallel+builds+in+Maven+3
from driver-binary-downloader-maven-plugin.
@Ardesco thanks a lot for your description. I think I won't get the time from my employer to do the necessary work. For now I will just ignore the warning.
from driver-binary-downloader-maven-plugin.
Related Issues (20)
- Does not work with Java 16 HOT 1
- Jar execute
- System architecture is not set to ARM on M1 mac HOT 1
- Doesn't extract chromedriver executable file anymore with chromedriver 115 or newer
- webdriver environemnt properties HOT 6
- unable to pass javax.net.ssl.trustStore into the plugin
- Perform a 1.0.17 Release HOT 2
- NullPointerException for an (formatted) Valid URL HOT 3
- SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" HOT 4
- maven property is not forwarded into forked execution HOT 1
- Allow dynamic disable of plugin HOT 2
- Not possible to set proxy settings on linux because ob . in the name HOT 1
- Minor correction to README.md
- Need to propagate driver location to Java HOT 5
- Any chance you could push a release? HOT 100
- Misbehavior with shortened URLs HOT 1
- Facing SunCertPathBuilderException: unable to find valid certification path to requested target
- Not able to download the latest Chrome Edge Driver Binary HOT 1
- always downloads even if files already exist HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from driver-binary-downloader-maven-plugin.