Open xuxiaofan1203 opened 8 months ago
Hello @guelfey, the dbus is very useful, but I found a potential bug when I used it. blocking position: https://github.com/godbus/dbus/blob/76236955d466b078d82dcb16b7cf1dcf40ac25df/conn.go#L302 In the test function TestSessionBus, after using the newConn, there is no newConn.Close() to awaken the <-conn.ctx.Done(). So the goroutine will block at the <-conn.ctx.Done(). We can call newConn.Close() to fix the bug probably. https://github.com/godbus/dbus/blob/76236955d466b078d82dcb16b7cf1dcf40ac25df/conn_test.go#L26-L32 you could reproduce the bug using goleak in the func TestSessionBus like this
Yes, I found the bug too. The newConn should be closed to awaken the ctx.Done().
Hello @guelfey, the dbus is very useful, but I found a potential bug when I used it. blocking position: https://github.com/godbus/dbus/blob/76236955d466b078d82dcb16b7cf1dcf40ac25df/conn.go#L302 In the test function TestSessionBus, after using the newConn, there is no newConn.Close() to awaken the <-conn.ctx.Done(). So the goroutine will block at the <-conn.ctx.Done(). We can call newConn.Close() to fix the bug probably. https://github.com/godbus/dbus/blob/76236955d466b078d82dcb16b7cf1dcf40ac25df/conn_test.go#L26-L32 you could reproduce the bug using goleak in the func TestSessionBus like this