Skip to content

Commit

Permalink
fix: Fix send congestion or send errors not causing connection shutdo…
Browse files Browse the repository at this point in the history
…wn and leaking connections
  • Loading branch information
driskell committed Jul 30, 2024
1 parent e453486 commit 02c8ede
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lc-lib/receiver/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ ReceiverLoop:
expectedAck := r.connectionStatus[connection].progress[0]
expectedEvent := expectedAck.event
receiver := expectedEvent.Context().Value(transports.ContextReceiver).(transports.Receiver)
receiver.Acknowledge(expectedEvent.Context(), expectedEvent.Nonce(), expectedAck.sequence)
if err := receiver.Acknowledge(expectedEvent.Context(), expectedEvent.Nonce(), expectedAck.sequence); err != nil {
r.failConnection(expectedEvent.Context(), receiver, connection, err)
}
r.scheduler.Set(connection, time.Second*5)
r.connectionLock.Unlock()
}
Expand Down
4 changes: 4 additions & 0 deletions lc-lib/transports/tcp/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ func (t *connection) senderRoutine() {
}()

t.senderErr = t.sender()
if t.senderErr != nil {
// Sender issue, close connections
t.shutdownFunc()
}
}

// sender handles socket writes
Expand Down

0 comments on commit 02c8ede

Please sign in to comment.