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

Fix concurrent data race problem #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

hilyjiang
Copy link

Data race test failed when in concurrent systems.

The test code can be found here: #74

@op
Copy link
Owner

op commented Feb 6, 2016

Can you fix this without using locks? In most cases, these things are initialised first thing and doesn't require locks.

@Astarry
Copy link

Astarry commented Jun 3, 2016

Please fix this. We are using go-logging, and this issue keeps coming up for us. We use golang for the concurrency. There is a race condition flagged in the concurrent read/write access to the map. One module is trying to log a stmt(multi.go line 25 function Log, which calls IsEnabledFor), while another is initializing its logger (multi.go line 51, which calls SetLevel). There is a concurrent read/write to the map (level.go line 65, levels map[string]Level in type moduleLeveled struct). The library works awesomely, other than the intermittent failure it causes our application because of this race condition.

@ccl0326
Copy link

ccl0326 commented Aug 12, 2016

In implementation of glog includes(C++, Golang), the vmoudle is fixed in running time.In C++ version glog, they use macro to make static anonymous variable in every module to store the log level.So i think if you want to fix this, change the moudle usage and some tricky technology should be required.

@ccl0326 ccl0326 mentioned this pull request Aug 12, 2016
billsegall added a commit to billsegall/aeron-go that referenced this pull request Dec 15, 2021
go-logging is unmaintained since 2016 and has significant reentrancy problems
causing crashes. See for example:
op/go-logging#75
op/go-logging#102
op/go-logging#105

To fix this we introduce a wrapper for a subset of the go-logging library
mapped on to Uber's zap logging library and switch to using that.
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

Successfully merging this pull request may close these issues.

4 participants