Skip to content

Commit d2f987e

Browse files
committed
rebase to master to merge apache#1343
1 parent 802aa69 commit d2f987e

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

pulsar/internal/connection.go

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -411,26 +411,16 @@ func (c *connection) run() {
411411
c.log.Debugf("Connection run starting with request capacity=%d queued=%d",
412412
cap(c.incomingRequestsCh), len(c.incomingRequestsCh))
413413

414-
go func() {
415-
for {
416-
select {
417-
case <-c.closeCh:
418-
c.failLeftRequestsWhenClose()
419-
return
420-
421-
case req := <-c.incomingRequestsCh:
422-
if req == nil {
423-
return // TODO: this never gonna be happen
424-
}
425-
c.internalSendRequest(req)
426-
}
427-
}
428-
}()
429-
430414
for {
431415
select {
432416
case <-c.closeCh:
417+
c.failLeftRequestsWhenClose()
433418
return
419+
case req := <-c.incomingRequestsCh:
420+
if req == nil {
421+
return // TODO: this never gonna be happen
422+
}
423+
c.internalSendRequest(req)
434424
case data := <-c.writeRequestsCh:
435425
if data == nil {
436426
return

0 commit comments

Comments
 (0)