Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@linyows
Copy link
Owner

@linyows linyows commented Oct 7, 2025

No description provided.

linyows and others added 2 commits October 8, 2025 00:00
The previous fix attempted to protect StepCounters map access with a
mutex, but the mutex was being copied by value when JobContext was
copied in executeJobRepeatLoopAsync. This created separate mutex
instances for each goroutine, breaking synchronization.

Changes:
- Changed countersMu from sync.Mutex to *sync.Mutex in JobContext
- Initialize countersMu pointer in all JobContext creation sites
- Update all test files to initialize countersMu properly

This ensures all goroutines share the same mutex instance, providing
proper synchronization for concurrent StepCounters map access.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
The mutex protecting overallSuccess in executeJobRepeatLoopAsync
was unnecessary. Using atomic.Bool is more efficient and cleaner
for simple boolean flag synchronization.

Changes:
- Replace var mu sync.Mutex with atomic.Bool
- Use overallSuccess.Store(false) instead of mutex-protected write
- Use overallSuccess.Load() for final return value

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link

github-actions bot commented Oct 7, 2025

Code Metrics Report

main (c2a21f3) #115 (4d12dc2) +/-
Coverage 47.7% 47.7% +0.0%
Code to Test Ratio 1:1.1 1:1.1 +0.0
Test Execution Time 59s 56s -3s
Details
  |                     | main (c2a21f3) | #115 (4d12dc2) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          47.7% |          47.7% | +0.0% |
  |   Files             |             52 |             52 |     0 |
  |   Lines             |           5226 |           5224 |    -2 |
+ |   Covered           |           2496 |           2497 |    +1 |
+ | Code to Test Ratio  |          1:1.1 |          1:1.1 |  +0.0 |
  |   Code              |          10521 |          10524 |    +3 |
+ |   Test              |          11651 |          11657 |    +6 |
+ | Test Execution Time |            59s |            56s |   -3s |

Code coverage of files in pull request scope (71.2% → 71.7%)

Files Coverage +/-
context.go 16.6% 0.0%
executor.go 66.3% +1.3%
job.go 82.8% 0.0%
workflow.go 68.1% 0.0%

Reported by octocov

@linyows linyows merged commit 34a5676 into main Oct 7, 2025
5 checks passed
@linyows linyows deleted the async branch October 7, 2025 15:11
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.

2 participants