Giter Club home page Giter Club logo

Comments (6)

ReinAchten-TomTom avatar ReinAchten-TomTom commented on June 8, 2024 3

We notice the same issue and for whatever reason we've started to see it more often recently. Can reproduce this quite easily locally when running actionlint in context of a repo with several (14 in my case) GitHub workflows:

while true; do
	output=`actionlint -format '{{json .}}' 2>&1`
	if [[ $output == *"fatal error: concurrent map"* ]]; then
		echo "FATAL ERROR SEEN"
		break
	fi
done

It's a bug (accessing a non thread-safe container concurrently) in actionlint that merely happens when a custom error message format is provided through -format. The map being accessed concurrently is ErrorFormatter.rules (see here).

We've noticed at least the following race condition regarding this map when RegisterRule is called from multiple concurrent check functions calls.

I'm not sufficiently familiar with the codebase to propose a good solution. A naive solution would be to use a thread-safe map instead, but I can't properly judge the performance implications.

from actionlint.

rhysd avatar rhysd commented on June 8, 2024 3

Let me check this issue this weekend. I don't have enough time to handle all projects for now.

from actionlint.

rhysd avatar rhysd commented on June 8, 2024 1

I apologize for the delay. I could fix this at d80a2a3. @ReinAchten-TomTom's comment was so helpful to fix this.

from actionlint.

ReinAchten-TomTom avatar ReinAchten-TomTom commented on June 8, 2024

@rhysd is this something you could look into or suggest how to best fix? I'm not proficient in golang, but can give it a try if you provide a hint. Thnx! 🙏

from actionlint.

noahnu avatar noahnu commented on June 8, 2024

I've run into this as well. Using an older version of actionlint in the meantime. Looking into the issue, it seems switching to sync.Map for the rules map may help?

from actionlint.

maikelvdh avatar maikelvdh commented on June 8, 2024

@rhysd thanks a lot for addressing this problem! is there any plan to release a new tagged version soon? 🙏

from actionlint.

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.