Happy New Year Steven!
I've run into an edge case where stop() is getting called on Python RTDPublisher instances when a cell disconnects which cuts the connection for other remaining subscribers. ( shutting down a shared service/database connection )
Observed on 0.18.7 py 3.11 64bit.
I haven't gotten a debugger hooked up to the C++ code but this function looked like a plausible trigger.
|
bool disconnect(size_t numSubscribers) override |
|
{ |
|
RtdPublisher::disconnect(numSubscribers); |
|
// TODO: check numSubscribers == 0 |
|
stop(); |
|
auto p = _parent.lock(); |
|
if (p) |
|
{ |
|
scoped_atomic_flag lock(p->busy); |
|
p->tasks.remove_if([&](auto& t) { return t.get() == this; }); |
|
} |
|
return true; |
|
} |
Assuming that the underlying xlo.RTDPublisher has properly implemented disconnect and stop functions, is there any need for line 111 at all? Even if predicated on numSubscribers==0, would there be a reason to call stop() here rather than from the disconnect function?
If not, the fix looks like it may just be a single line deletion 🤞
Happy New Year Steven!
I've run into an edge case where
stop()is getting called on PythonRTDPublisherinstances when a cell disconnects which cuts the connection for other remaining subscribers. ( shutting down a shared service/database connection )Observed on 0.18.7 py 3.11 64bit.
I haven't gotten a debugger hooked up to the C++ code but this function looked like a plausible trigger.
xloil/src/xlOil-COM/RtdAsyncManager.cpp
Lines 107 to 119 in ac9b361
Assuming that the underlying
xlo.RTDPublisherhas properly implementeddisconnectandstopfunctions, is there any need for line 111 at all? Even if predicated onnumSubscribers==0, would there be a reason to callstop()here rather than from thedisconnectfunction?If not, the fix looks like it may just be a single line deletion 🤞