pgdriver: discarding bad listener connection #594
Answered
by
vmihailenco
ivanakimov
asked this question in
Q&A
-
When running something similar to this, sometimes I notice:
Two questions:
|
Beta Was this translation helpful? Give feedback.
Answered by
vmihailenco
Jun 27, 2022
Replies: 2 comments 1 reply
-
That error happens when you can't consume all messages from the Listener channel fast enough. Probably the consuming loop crashed or is blocked for too long. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ivanakimov
-
I got a stable reproduction of the error. Change this lines: https://github.com/uptrace/bun/blob/master/example/pg-listen/main.go#L41-L43 To above: // if err := ln.Listen(ctx, "mychan1", "mychan2"); err != nil {
// panic(err)
// }
for {
select {
case notif := <-ln.Channel():
fmt.Println(notif.Channel, notif.Payload)
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That error happens when you can't consume all messages from the Listener channel fast enough. Probably the consuming loop crashed or is blocked for too long.