☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Locking needed?

Community Supportserver
Nirwa
Nirwa

In a previous version of my web app (using bokeh standalone server version <=3.3), I have seen issues (file corruption) when my users are simultaneously executing the pandas.DataFrame.to_csv call, which is used to save a small amount of state for an interaction with a specific subset of our large set of data.
And sorry, hard to design a simple example–the only test I have found is to have a number of colleagues hit our rather large app hard at the same time.
Unfortunately the nature of usage seems to mean that this is not a one-off.
Is this a know issue? Is there a sensible way to lock the pandas action?
Niels

⌁   Link to post
Bryan
Bryan

Bokeh is asynchronous, but not multi-threaded, so I am not sure where the kind of locking you suggest would come into play? Are all user sessions trying to write to the same file?

⌁   Link to post
Nirwa
Nirwa

No. Same file name, different working directory–so for some reason things get jumbled up.
Like you say–single thread, async: this shouldn’t happen. So I am barking up the wrong tree.
Saying this out loud, I probably should check that I specify the full path, rather than rely on a working directory, which could explain why it fails for a single thread.
Thanks for making sure I am looking in a more sensible place.

⌁   Link to post
Bryan
Bryan

Just spitballing more: you only have one instance of the server running? If you were running multiple server instances behind a load balancer then that could potentially lead to issues (but, AFAIK, I only if the same path was used in multiple places).

⌁   Link to post

End of archived discussion · Replies are disabled