Commit fee5d42
committed
Drop context.Context implementation from Deadline
Deadline never satisfied the Context contract. Set revives it, so Err
goes from non-nil back to nil and Done hands out a new channel while
earlier holders still see the old one closed: two observers of the
same "context" disagreeing permanently. Any context derived from it
can panic in the standard library, because both propagateCancel paths
read parent.Err() after observing Done, and cancelCtx.cancel panics
on a nil error. This reproduces today with no callback API involved.
Dropping the no-op Value method breaks the interface assertion and
turns those derivations into compile errors. Callers that want a
context should use Deadline.Context, which is monotonic. Set, Done,
Err and Deadline are untouched: across pion/transport, pion/dtls and
pion/sctp the only methods invoked on a Deadline are Set and Done.
Known downstream fallout, both passing a Deadline to an unexported
function that takes a context.Context:
pion/dtls conn.go:586 c.contextWithClose(c.writeDeadline)
pion/sctp stream.go:330 sendPayloadData(s.writeDeadline, chunks)1 parent b2a362c commit fee5d42
1 file changed
Lines changed: 0 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | 31 | | |
34 | | - | |
35 | 32 | | |
36 | 33 | | |
37 | 34 | | |
| |||
170 | 167 | | |
171 | 168 | | |
172 | 169 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
0 commit comments