lib / pq

Pure Go Postgres driver for database/sql
https://pkg.go.dev/github.com/lib/pq
MIT License
8.86k stars 908 forks source link

Potential leak in notify.go #1126

Open hhheiaenia opened 1 year ago

hhheiaenia commented 1 year ago

In file https://github.com/lib/pq/blob/master/notify.go#L585, I notice that when the if condition is met, the Wait() blocks the goroutine and waits for a single. So I was wondering that is there something that prevents the goroutine from being woken up? Could the unblock signal always unblock the goroutine?

johto commented 8 months ago

So I was wondering that is there something that prevents the goroutine from being woken up?

The listenerConnMain goroutine should eventually wake it up.

Could the unblock signal always unblock the goroutine?

I'm not sure I understand what you're asking here. Could you explain in a bit more detail?