You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f6bedf2
Browse filesBrowse the repository at this point in the historyBrowse files
fix(lib): Run no longer leaks the worker pool on break-and-cancel
The forwarder in pkg/subenum.Run did an unguarded send, so the common
`for ev := range events { break }` plus deferred cancel left the engine's
workers blocked forever (about 100 goroutines per run). After
cancellation the forwarder now keeps draining the engine without waiting
for a reader: other events are dropped when the buffer is full and the
final KindDone waits at most a second. A caller that keeps reading still
gets KindDone.
Also: DefaultWords parses the bundled list once (sync.OnceValue + clone),
and a positive sub-millisecond Timeout rounds up to 1ms instead of being
rejected as 0.
Fixes#112
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
30
30
- The minimum Go version is now 1.26 (`go 1.26.0` in go.mod), required by current `golang.org/x/sys` and `golang.org/x/text`; both were bumped and `govulncheck -show verbose` now reports no vulnerable modules. Dependabot also updates indirect modules, and CI lints with errorlint, nilerr, contextcheck, noctx, copyloopvar, usestdlibvars and revive, with errcheck exemptions narrowed to stdout prints (#83).
31
31
32
32
### Fixed
33
+
-`pkg/subenum.Run` no longer leaks the scan's worker pool when a caller breaks out of the event loop and cancels without draining (about 100 goroutines per run before): after cancellation the forwarder never waits for a reader, so every goroutine exits within about a second. `DefaultWords` parses the bundled list once, and a positive `Timeout` below 1ms is rounded up instead of being rejected as 0 (#112).
33
34
- A resolver pool member that answers NXDOMAIN for names that exist can no longer silently hide them. Each member is checked with canaries (names the trusted resolver confirmed, starting with the apex), and an NXDOMAIN from a member that has not passed a canary is confirmed by a second member. A member contradicted three times (a hidden name, a failed canary, or a hit the trusted resolver denies) is flagged and dropped for the rest of the run; the per-resolver report gains `canaries`, `contradicted` and `flagged`. In a hermetic test, one always-NXDOMAIN member previously hid half the real names; now none are lost. In a zone with no known name to use as a canary, NXDOMAIN answers cost a second pool query until one is found (#105).
34
35
-`-diff` no longer reports names this run never tested as removed. Every previous name the run did not find is looked up again with the trusted resolver, and only NXDOMAIN counts as removed; names that still resolve (a smaller wordlist, no `-recursive` or `-permute`, now wildcard-filtered) or whose lookup fails are counted as `still_resolving` and `unverified` in the report's `diff` object instead (#110).
35
36
- Resuming a `-permute` scan no longer skips the permutation pass: the main pass's resume position was applied to the permutation candidates, so a resumed pass queried nothing. The pass now saves and resumes from its own position, and is seeded only with the main pass's names so the resumed candidate list is identical (#107).
Copy file name to clipboardExpand all lines: docs/library.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ for ev := range events {
57
57
}
58
58
```
59
59
60
-
Drain the channel, or cancel `ctx` and then drain it. A consumer that stops reading blocks the scan once the buffer fills. Cancelling still delivers`KindDone` with the counts so far.
60
+
Read the channel until it closes, or cancel `ctx`. Breaking out of the loop with a deferred `cancel()` is safe: once `ctx` is cancelled the scan stops without waiting for a reader, and its goroutines exit within about a second whether or not the channel is read. A consumer that keeps reading after cancelling still gets`KindDone` with the counts so far. While `ctx` is live, a consumer that stops reading pauses the scan once the buffer fills.
0 commit comments