Skip to contentSkip to conversation

service: 'ready' Status ProprtyChanged not sent

DISCUSSION Geoffrey Van Landeghem 1 participant 1 message Nov 17, 2022

lore
Share & tools
lore
#0 lore raw

What was missing earlier were some logs. Below is the output of connmanctl monitor:

Technology   ethernet             Connected = True
Manager                           State = ready
Manager      ServicesChanged      = {
*AR Wired                ethernet_xxxxxxxxxxxx_p13_cable
}, {
}
Service      ethernet_xxxxxxxxxxxx_p13_cable IPv4 = [ Method=dhcp, Address=192.168.0.101, Netmask=255.255.255.0, Gateway=192.168.0.1 ] Service      ethernet_xxxxxxxxxxxx_p13_cable Nameservers = [ 192.168.0.1 ]

As you can see the 'State' PropertyChanged on the Service is missing.
After reading the service api docs I'm confident that this is a regression.
I dug a bit further and found that it's actually due to the allow_property_changed that is blocking any PropertyChanged for a while. Example:

Nov 17 14:00:30.957 hostname connmand[8343]: ../../../../../../workspace/sources/connman/src/service.c:service_schedule_added() service 0x21146b8
...
Nov 17 14:00:30.966 hostname connmand[8343]: ../../../../../../workspace/sources/connman/src/service.c:__connman_service_ipconfig_indicate_state() service 0x21146b8 (ethernet_xxxxxxxxxxxx_p13_cable) old state 1 (idle) new state 3 (configuration) type 1 (IPv4)
Nov 17 14:00:30.966 hostname connmand[8343]: ../../../../../../workspace/sources/connman/src/service.c:service_indicate_state() service 0x21146b8 old idle - new configuration/idle => configuration
Nov 17 14:00:30.966 hostname connmand[8343]: ../../../../../../workspace/sources/connman/src/session.c:service_state_changed() service 0x21146b8 state 3
Nov 17 14:00:30.966 hostname connmand[8343]: ../../../../../../workspace/sources/connman/src/notifier.c:notify_idle_state() idle 0
Nov 17 14:00:30.966 hostname connmand[8343]: ../../../../../../workspace/sources/connman/src/manager.c:idle_state() idle 0
Nov 17 14:00:30.966 hostname connmand[8343]: ../../../../../../workspace/sources/connman/src/service.c:state_changed() service 0x21146b8 /net/connman/service/ethernet_xxxxxxxxxxxx_p13_cable state_changed = configuration
Nov 17 14:00:30.966 hostname connmand[8343]: ../../../../../../workspace/sources/connman/src/service.c:allow_property_changed() service 0x21146b8 /net/connman/service/ethernet_xxxxxxxxxxxx_p13_cable allow_property_changed = false
...
Nov 17 14:00:31.295 hostname connmand[8343]: ../../../../../../workspace/sources/connman/src/service.c:service_send_changed()

I haven't added the full log here, just an example of the State property.
It boils down to the fact that every PropertyChanged in between 'service_schedule_added' and 'service_send_changed' is not allowed to propagate. And I noticed in the full log that it's not only about the 'state' property but in fact a handful of PropertyChanged events.

So it seems the delay was added there on purpose, so I'm wondering why it was implemented that way. Any clues here?