summaryrefslogtreecommitdiff
path: root/internal/eventloop_state.go
AgeCommit message (Collapse)Author
2026-05-28close_range: honor last bound and CLOSE_RANGE_CLOEXEC flagPaul Buetow
close_range was captured as a single-fd fd_event carrying only first, so the runtime evicted every tracked fd >= first, ignoring the last upper bound and the flags. Bounded calls wrongly dropped still-open higher fds, and CLOSE_RANGE_CLOEXEC (which keeps fds open) was treated as a full close. Reclassify close_range to the two_fd_event kind, mapping fd_a/fd_b/extra to first/last/flags. The runtime now closes only the inclusive [first, last] range (a negative last from ~0U means unbounded) and skips eviction when CLOSE_RANGE_CLOEXEC is set or the syscall fails. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-12extract generic trimLRU helper to eliminate DRY violation in eventloop_state.goPaul Buetow
Replace three near-identical trimOldest* functions with a single generic trimLRU[K comparable, V any] helper; the three wrappers now delegate to it, with trimOldestPendingPairs passing a cleanup callback for Recycle. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18fix task 45: bound pending handle cleanupPaul Buetow
2026-03-18refactor: extract pairTracker and extend fdTracker to reduce eventLoop ↵Paul Buetow
responsibilities (task 428) The eventLoop struct held 20+ fields across 5+ responsibilities (SRP violation). Extract two cohesive sub-structs: - pairTracker: enter/exit pair matching, age-based LRU pruning, and DurationToPrev tracking. Replaces enterEvs/enterEvAges/prevPairTimes/ maxPendingEnterEvs/cacheAge fields with a single embedded value. - fdTracker (extended): absorbs procFdCache/procFdAges/maxProcFdCacheSize, moving all procfs-resolution cache logic (resolve, cache, prune, delete) off eventLoop and onto the tracker that already owns the fd table. eventLoop drops from 20 fields to 12. All methods that previously reached into eventLoop fields now live on the struct that owns the data. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-03-13Refactor event loop into focused units (task 389)Paul Buetow