Hi all,
My application removes existing models - i.e. layouts or figures - from its associated Bokeh document each time a new acquisition sequence is launch.
The data attached to each model is periodically streamed. Each data update generates seems to generate a 'pending write' on the (embedded) server queue in order to update the frontend.
Despite the fact that the periodic update mechanism is disabled when I remove the models from the document, I systematically get the following error:
Traceback (most recent call last):
File “DataStreamingModel.py”, line 693, in __clear_models self._doc.remove_root(m, setter=session)
File “/home/informatique/ica/leclercq/miniconda2/lib/python2.7/site-packages/bokeh/document.py”, line 579, in remove_root self._trigger_on_change(RootRemovedEvent(self, model, setter))
File “/home/informatique/ica/leclercq/miniconda2/lib/python2.7/site-packages/bokeh/document.py”, line 721, in _trigger_on_change self._with_self_as_curdoc(invoke_callbacks)
File “/home/informatique/ica/leclercq/miniconda2/lib/python2.7/site-packages/bokeh/document.py”, line 703, in _with_self_as_curdoc return f()
File “/home/informatique/ica/leclercq/miniconda2/lib/python2.7/site-packages/bokeh/document.py”, line 720, in invoke_callbacks cb(event)
File “/home/informatique/ica/leclercq/miniconda2/lib/python2.7/site-packages/bokeh/document.py”, line 683, in self._callbacks[receiver] = lambda event: event.dispatch(receiver)
File “/home/informatique/ica/leclercq/miniconda2/lib/python2.7/site-packages/bokeh/document.py”, line 111, in dispatch receiver._document_patched(self)
File “/home/informatique/ica/leclercq/miniconda2/lib/python2.7/site-packages/bokeh/server/session.py”, line 170, in _document_patched raise RuntimeError…
RuntimeError: _pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes
``
So the questions is: do I have to 'lock' the document - in a way or another - before trying to remove any model?
Otherwise, is there a way to clear the 'pending writes' on the server?
Thanks for your help.
Nicolas.


