GithubHelp home page GithubHelp logo

Comments (6)

cherylking avatar cherylking commented on September 15, 2024

@blirp Thank you for bringing this to our attention. We would like to understand your particular use case. Can you describe your project configuration / setup?

We have no reason to believe that our goals (other than dev mode which is meant to be a single interactive session) are not thread safe, but we have not taken the step to document them as such.

from ci.maven.

cherylking avatar cherylking commented on September 15, 2024

I have found two instances of static variables that should be looked at. One is in CommonLogger (this may be more tricky to change) and the other is in StartDebugMojoSupport (configFilesCopied variable).

from ci.maven.

blirp avatar blirp commented on September 15, 2024

I have a medium sized application with 44 modules in total, and about 500K of Java code. (And an unknown number of Spring XML configuration). The application is split into three main modules, 'common', 'frontend' and 'backend'. Mostly JSP. We use Liberty for both the frontend and backend modules.

My hope was that giving Maven some more threads, we could speed up build times a bit. That gave various warnings about non-thread-safe plugins. Most I could easily update, but not the liberty-maven-plugin.

from ci.maven.

bmarwell avatar bmarwell commented on September 15, 2024

I have found two instances of static variables that should be looked at. One is in CommonLogger (this may be more tricky to change) and the other is in StartDebugMojoSupport (configFilesCopied variable).

Why do you thing the static logger could be a problem? If it is final, I do not see a problem here.

and the other is in StartDebugMojoSupport (configFilesCopied variable).

This one:

I don't see why not just make it non-static. If I am not mistaken, maven plugins are loaded in their own ClassLoader. That means as long as the plugin does not run twice in the same module at the same time with the same goal (which is unlikely for StartDebugMojoSupport), this should work.

from ci.maven.

cherylking avatar cherylking commented on September 15, 2024

@bmarwell Thanks for looking at those. I agree that the static variable in StartDebugMojoSupport can just be made non-static.

As for the CommonLogger, I suppose I could make the logger static variable final. But the loggerImpl referenced by that static logger can change with every call to getInstance, which seems problematic to me if called from multiple threads. Maybe I am overthinking it?

from ci.maven.

cherylking avatar cherylking commented on September 15, 2024

Just found another class that needs modifications for thread safety in ci.common. It is utilizing a lot of static variables. Not sure of the history there. Will look into changing those to non-static variables.

from ci.maven.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.