parkouss/funq

Race condition in "object_set_properties"

Closed this issue · 1 comments

The command "object_set_properties" uses a queued signal/slot connection for its execution, so the TCP response may be sent before the property was actually set. If the command "object_properties" follows immediately, it could return the old property values instead of the new ones!

connect(this, SIGNAL(emit_object_set_properties(QObject *, const QVariantMap &)),
this, SLOT(_object_set_properties(QObject *, const QVariantMap &)),
Qt::QueuedConnection);

I noticed that because the functional test test_retrieve_widget.py:TestRetrieve.test_widget_set_properties fails sporadically.

So we must make sure that the response is always sent after the properties are set.

Hm, thanks for the investigation, it sounds like what you describe can happen indeed. I don't remember why the method used was set to queued - maybe trying to not use direct connection would solve this, not sure if that is doable.