Skip to content

Commit

Permalink
fix: don't set Deadline if pipe is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
nange committed Aug 2, 2024
1 parent 54abadd commit d23ae01
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions util/netpipe/pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ func (p *pipe) SetWriteDeadline(t time.Time) error {
p.cond.L.Lock()
defer p.cond.L.Unlock()

if p.closed {
return ErrPipeClosed
}

uid, err := uuid.NewV7()
if err != nil {
return err
Expand Down Expand Up @@ -201,6 +205,10 @@ func (p *pipe) SetReadDeadline(t time.Time) error {
p.cond.L.Lock()
defer p.cond.L.Unlock()

if p.closed {
return ErrPipeClosed
}

uid, err := uuid.NewV7()
if err != nil {
return err
Expand Down

0 comments on commit d23ae01

Please sign in to comment.