Browse Source

timeout

pull/7231/head
chrislu 2 months ago
parent
commit
e501abcde6
  1. 8
      weed/mq/kafka/protocol/handler.go

8
weed/mq/kafka/protocol/handler.go

@ -305,6 +305,14 @@ func (h *Handler) HandleConn(ctx context.Context, conn net.Conn) error {
var finalResult readResult var finalResult readResult
var finalErr error var finalErr error
// Ensure the done channel is always signaled to clean up timeout goroutine
defer func() {
select {
case done <- true:
default:
}
}()
// Start a timeout goroutine that will force completion after 1 second // Start a timeout goroutine that will force completion after 1 second
go func() { go func() {
select { select {

Loading…
Cancel
Save