Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d736f07
refactor(epoll): move the dirty-list pass into Loop.flushDirty (no be…
FumingPower3925 Sep 26, 2026
17b8038
test(epoll): failing-first rigs for celeris#669 and celeris#668
FumingPower3925 Sep 26, 2026
350b94c
fix(epoll): never park the loop on a running async handler, and leave…
FumingPower3925 Sep 26, 2026
e3c043f
test(epoll): pin the accept-install lock and the owed-close transplan…
FumingPower3925 Sep 26, 2026
6ce9cdb
test(epoll): correct the celeris#654 rig note about drainRead's EOF b…
FumingPower3925 Sep 26, 2026
fdd747f
fix(epoll): hand given-up conns back instead of dropping them, settle…
FumingPower3925 Sep 26, 2026
8e0e27b
perf(epoll): skip the hijacked load for sync conns in the dirty pass …
FumingPower3925 Sep 26, 2026
de7a206
test(epoll): two queue entries for a hijacked conn reach no pooled co…
FumingPower3925 Sep 26, 2026
f11d5e1
test(epoll): take the released descriptor number for the pipe instead…
FumingPower3925 Sep 26, 2026
e038a40
test(epoll): pin the EPOLLRDHUP guard on a closing conn directly (cel…
FumingPower3925 Sep 26, 2026
df2bcb7
test(epoll): failing-first rig for a deferred transplant finished on …
FumingPower3925 Sep 26, 2026
ae35481
fix(epoll): finish a deferred transplant only after its dispatch goro…
FumingPower3925 Sep 26, 2026
c12b6e5
Merge branch 'main' into fix/celeris-669-668-epoll-async-ownership
FumingPower3925 Sep 27, 2026
cbf529f
test(epoll): pass deferAccept to createListenSocket in the off-thread…
FumingPower3925 Sep 27, 2026
c9b9b16
test(epoll): the EPOLLOUT resume must neither flush nor re-arm a conn…
FumingPower3925 Sep 27, 2026
f74b783
fix(epoll): the EPOLLOUT resume skips a conn an async Hijack took, an…
FumingPower3925 Sep 27, 2026
474beb6
test(epoll): make the accept-after-hijack test's number reuse happen …
FumingPower3925 Sep 27, 2026
29f100e
test(epoll): arming or disarming EPOLLOUT must not reach the number a…
FumingPower3925 Sep 27, 2026
60fd47b
fix(epoll): never arm or disarm EPOLLOUT by the number of a conn an a…
FumingPower3925 Sep 27, 2026
0eb283f
perf(epoll): no defer around modEpollOut's lock, and a benchmark of t…
FumingPower3925 Sep 27, 2026
0dbd529
test(epoll): the hijack fixture fails instead of skipping, so CI cann…
FumingPower3925 Sep 27, 2026
458f536
Merge branch 'main' into fix/celeris-669-668-epoll-async-ownership
FumingPower3925 Sep 27, 2026
1711e06
Merge branch 'main' into fix/celeris-669-668-epoll-async-ownership
FumingPower3925 Sep 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion engine/epoll/adopt.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,14 @@ func (l *Loop) attachAdoptedFD(ctx context.Context, fd int, carry engine.Carryov
if fd >= len(l.conns) {
l.growConns(fd)
}
if l.conns[fd] != nil {
// The slot is read and, below, filled under driverMu: an async Hijack on
// this loop clears a slot from its dispatch goroutine under this lock and
// then closes the descriptor, whose number the kernel may reissue to the
// connection being adopted here (celeris#668).
l.driverMu.Lock()
occupied := l.conns[fd] != nil
l.driverMu.Unlock()
if occupied {
// Slot occupied — the source detached fd before handing it off, so this
// should not happen; refuse rather than clobber a live conn. Do not close
// (the slot holder may close the same descriptor later). The connection
Expand All @@ -186,7 +193,9 @@ func (l *Loop) attachAdoptedFD(ctx context.Context, fd int, carry engine.Carryov

cs := acquireConnState(ctxkit.WithWorkerID(ctx, l.id), fd, l.resolved.BufferSize, l.async)
cs.remoteAddr = carry.RemoteAddr
l.driverMu.Lock()
l.conns[fd] = cs
l.driverMu.Unlock()
l.addLiveConn(cs)
l.connCount++
if fd > l.maxFD {
Expand Down
6 changes: 3 additions & 3 deletions engine/epoll/ask.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ package epoll
//
// It reads only what THIS goroutine owns: cs.h1State and cs.h2State are
// written by switchToH2Local on this goroutine, and Detached and
// asyncH2Promoted are atomics. cs.protocol, cs.detected and cs.hijacked are
// the loop thread's and are deliberately NOT read here — the sweep, which
// runs there, screens those.
// asyncH2Promoted are atomics. cs.protocol and cs.detected are the loop
// thread's, and cs.hijacked is set by a hijack on this very goroutine; none
// is read here — the sweep, which runs on the loop thread, screens them.
func (l *Loop) askAtPark(cs *connState) {
if l.transplant.Load() == nil {
return
Expand Down
Loading
Loading