-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(dbus): New[User|System]ConnectionContext doesn't respect incoming context.Context #398
Comments
Thanks for the report. |
Hi @lucab, thanks for the reply. I just took a quick look with a debugger // 1
func NewSystemConnectionContext(ctx context.Context) (*Conn, error) {
return NewConnection(func() (*dbus.Conn, error) {
return dbusAuthHelloConnection(ctx, dbus.SystemBusPrivate)
})
}
// 2
func NewConnection(dialBus func() (*dbus.Conn, error)) (*Conn, error) {
sysconn, err := dialBus()
// so the go anonymous function gets called
func dbusAuthHelloConnection(ctx context.Context, createBus func(opts ...dbus.ConnOption) (*dbus.Conn, error)) (*dbus.Conn, error) {
conn, err := dbusAuthConnection(ctx, createBus)
// which in terms calls the go-dbus SystemBusPrivate method with conniption dbus with Context
conn, err := createBus(dbus.WithContext(ctx))
if err != nil {
return nil, err
} Development Error 1 -
|
ping @lucab |
It sounds like you have pinpointed some faulty logic in That said, I also fear that you may be chasing a ghost. |
Hi Community,
I a recent event, I just discovered that the two functions to establish dbus connection doesn't handle context deadline event
this throws:
Same for
And when integrated with large software, it makes debugging a lot harder. I think here it's best to use standard
context.DeadlineExceeded
error when such a scenario occurs. Thank you!The text was updated successfully, but these errors were encountered: