go.dbus icon indicating copy to clipboard operation
go.dbus copied to clipboard

May be shouldn't auto invoke Conn.inWoker.

Open snyh opened this issue 12 years ago • 2 comments

There is an problem when invoke Conn.inWoker before an dbus object has be exported.

If objectpath A is exported after invoked Conn.inWoker then bus message to objectpath A will be discarded before objectpath A is exported. (I think this is normal and only way now)

And this scene will happen when an dbus serivce is launched by dbus-daemon (service file) caused application freeze (wait dbus timeout).

snyh avatar Nov 24 '13 14:11 snyh

seems like even invoke inWoker later manually still cause this problem.

because the SessionBus()/SystemBus() will invoke conn.Hello() or the name acquire dbus message which rely on inWoker is invoked.

snyh avatar Nov 24 '13 14:11 snyh

I workaround this by https://github.com/linuxdeepin/go-lib/commit/514c14fad3d315379105fb6fe5af439bbf64c9b4

use DBUS_STARTER_BUS_TYPE env to detect wehter this program is launched by dbus-daemon. Then use an unhandledMsgs map[string][]*Message (inside Conn) to store unhandled type=method_call message, and handl it in func (conn *Conn) RequestName.

Wish you can find more elegant way to solve this problem.

snyh avatar Nov 29 '13 02:11 snyh