I am running a bokeh application in bokeh server mode (version 2.4.1) with an authentication module. The application retrieves data via SQL and visualizes the data. This works all fine except that when I start a new session, the bokeh server creates the application twice, i.e. I can see from the debug output that the data authentication module, the data retrieval and the visualization get called twice.
Is there any reason which causes the bokeh server to recreate a session?
Some observations I have made during debugging this double creation:
- creating the session twice only happens when I use add_next_tick_callback to add one “populate”-callback which adds next_tick_callbacks for data retrieval and visualization.
- If I run the methods for data retrieval and visualization directly in the application code, then there is no double creation
- When I change the SQL query (add a where clause) then the double creation vanishes, too.
- the session id is the same after both sessions have been created.