Skip to content

operation.go: guard global mem from concurent writes on startup and config#124

Merged
diegoholiveira merged 1 commit intodiegoholiveira:mainfrom
Moisi:safer_operations_map
Jun 10, 2025
Merged

operation.go: guard global mem from concurent writes on startup and config#124
diegoholiveira merged 1 commit intodiegoholiveira:mainfrom
Moisi:safer_operations_map

Conversation

@Moisi
Copy link
Copy Markdown
Contributor

@Moisi Moisi commented Jun 10, 2025

On our project all unit-test must run with Parallel() and with -race flag enabled.
Having jsonlogic not guarding a shared memory makes it hard for us to run unit-test and search for possible bugs.

This PR introduces a mutex around writes to the operations map, helping race-detector relax a bit.

I'm happy to expand on this PR as required by the project guidelines.
Ohad

…onfig

Signed-off-by: Ohad Moisi <omoisi@akamai.com>
@Moisi Moisi force-pushed the safer_operations_map branch from 1ce07c1 to cf2ad20 Compare June 10, 2025 00:27
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.07%. Comparing base (0714ba8) to head (cf2ad20).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #124      +/-   ##
==========================================
+ Coverage   97.05%   97.07%   +0.01%     
==========================================
  Files           9        9              
  Lines         883      889       +6     
==========================================
+ Hits          857      863       +6     
  Misses         17       17              
  Partials        9        9              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@diegoholiveira diegoholiveira merged commit 122b90f into diegoholiveira:main Jun 10, 2025
7 checks passed
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.

3 participants