I am writing an application (bokeh server application) showing several lines from a pandas dataset (read from CSV files).
My problem is that in some cases, when I load the application I got the following error message about Document lock while updating some glyph properties (visible or data source) :
error: RuntimeError(’_pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes’)
self.lines[line].data_source.data = dict(self.dataSource[line].data)
The document is updated with a callback on some Select widget.
An initial update is performed from the main program.
As I have read from previous posts, this probleme can happen is the document is updated from a thread (not the case).
Sorry not to be able to post a minimal reproducible example now, I am trying to eliminate some part of the code to make it clearer.
As the application is full of buttons that trigger updates of the document or the glyph, I would like to know how it is possible to check that the document is locked or if there is a pending operation on it ?
Also, is it normal (for test, maybe stupid question) that if I try to connect to the same application from several tabs of a browser I also get a document lock error ? Is it because I have functions taking too much time ?
With a minimal example of a figure I have no problem.
My version is : Bokeh version : 2.2.3 / Debian 10.2