
Hi,
I use a bokeh server that is loaded when accessing a flask route. I am trying to make the server work with num-procs != 1. There is no problem when using num-procs 1
The bokeh server is started with :
panel serve --num-procs 0 --use-xheaders --port $BOKEH_PORT --address 0.0.0.0 --allow-websocket-origin=* $CYCLOBS_HTTP_DIR/bokeh_apps/[^__]* &
@app.route('/cyclone/<sid>')
def trackServer(sid):
#Stuff ...
# Retrieve the script to include the bokeh app to the page.
script = server_document('http://derive.ifremer.fr/bokeh_server/panel', arguments={"sid": sid})
# Other stuff...
return render_template("cyclone.html", script=script, resources=CDN.render(), template="Flask",
years=getAllAvailYears(),
cycInfos=cycInfos, year=cycInfos[1].year, basin=cycInfos[4][0], sid=sid, hasAcq=hasAcq)
In server_document function, I am passing a URL argument ‘sid’.
What is not working :
When using num-procs != 1, and accessing the bokeh server through the flask route, the bokeh server application does not always receive the url argument.
To be more precise :
- The flask route is accessed
- The bokeh server loads a first time, always correctly receiving the URL argument
- Soon after, the bokeh server seems to load the app a second time, this time the URL argument is not always received (curdoc().session_context.request.arguments is empty)
After the second loading, if the url argument is correctly received, the application shows in the browser. If not received, the app crash because it needs this argument.
In my code, the line failing is :
args = curdoc().session_context.request.arguments because the returned dict should contain my url argument name and value
What I tried :
It is correctly working when directly accessing the bokeh application in my browser (not going through the flask route) When doing this, the bokeh app still seems to load 2 times, but both times it correctly gets the URL argument.
Could it be an issue with server_document ? Something I’m doing wrong ?
Probably related but issues are closed (and fixed):



