Skip to content

merge v1.2.6#135

Open
M09Ic wants to merge 3 commits intomasterfrom
fix/channel-close-panic
Open

merge v1.2.6#135
M09Ic wants to merge 3 commits intomasterfrom
fix/channel-close-panic

Conversation

@M09Ic
Copy link
Contributor

@M09Ic M09Ic commented Mar 6, 2026

No description provided.

M09Ic and others added 3 commits March 6, 2026 23:43
… parse failure

- Replace close(additionCh) with additionClosed atomic.Bool flag to
  prevent panic when async producers (redirect/crawl/retry/append)
  write after pool shutdown
- Guard addAddition() with ctx.Err() and additionClosed check before send
- ParseRawResponse failure no longer marks baseline as invalid or
  returns early; log at debug level instead
- Read Location header from live response (resp.GetHeader) instead of
  re-parsed bl.Response.Header for reliability
- Add ParseRawResponse boundary tests (nil, empty, truncated, binary, etc.)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace additionClosed atomic with ctx-based guard in addAddition
- Add handlerDone chan to coordinate Handler goroutine lifecycle
- Add sendProcess method with select+ctx.Done protection
- Protect putToOutput/putToFuzzy/checkCh sends with select+ctx.Done
- Rewrite BrutePool.Close/CheckPool.Close with correct shutdown order:
  Cancel → Release pools → close(processCh) → <-handlerDone
- Fix doCrawl orphan wg.Add(1) with defer wg.Done()
- Fix analyzeDone inverted condition (replaced with handlerDone chan)
- Add ctx.Done check to Run monitor goroutine

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 19 tests in core/pool/pool_test.go covering:
- addAddition: normal, after cancel, wg balance, full buffer, concurrent
- sendProcess: normal, after cancel, full buffer, concurrent
- putToOutput/putToFuzzy: normal, after cancel, Outwg balance
- Handler lifecycle: processCh close exits handler, drains all items
- Shutdown sequence: no deadlock, cancel mid-flight
- Goroutine leak detection after full shutdown

Add .github/workflows/ci.yml:
- Runs on PR to master and push to master
- Tests on ubuntu-latest and windows-latest
- go build, go test -race, go vet

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant