-
-
Notifications
You must be signed in to change notification settings - Fork 518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bokeh] Closing connection: No msgid in header #1148
Comments
Thanks for the detailed issue. I suspect this will have to be filed upstream in bokeh. |
I can reproduce this in panel, but only under a stress test. Can't reproduce in bokeh at this point. Seeing that panel does some handling of websocket-level protocol, I'm tempted to say that this is a panel issue, but without further debugging this may go either way. |
Can no longer reproduce this with bokeh 2.0 and Panel 0.9.1. Any chance you could give those versions a go and try again? |
|
Closing then, please reopen if this can be reproduced. |
I can reproduce it unfortunately. I don't know if it's what you'd call a stress test, the GIF displays the real speed. Notice that the I created the env with
To reproduce these errors, I ran the following script with import param
import panel as pn
class Dummy(param.Parameterized):
a = param.Number(default=1, bounds=(0, None), step=0.1)
b = param.Number(default=10, bounds=(0, 20), step=0.5)
c = param.Number(default=10, bounds=(0, None), step=0.05)
@param.depends("a", "b", watch=True)
def update_c(self):
self.c = self.a * self.b
dummy = Dummy()
app = pn.panel(dummy)
app.servable() |
I tested a bokeh variant of this code yesterday. Testing the right code I can confirm the issue is still present. |
Strangely enough I still can't reproduce, even if I lower the step. Can't explain it yet. |
Okay, I had an older version of tornado, upgrading to 6.0.4 let's me reproduce it. |
Okay, the issue is that we are working around the asynchronous nature of the server. This is to allow synchronous functions to trigger updates on the frontend immediately instead of blocking until they finish, e.g.: import panel as pn
import time
button = pn.widgets.Button(name='Run')
progress = pn.widgets.Progress(value=0)
def update_progress(event):
for i in range(100):
time.sleep(0.01)
progress.value = i
button.on_click(update_progress)
pn.Row(button, progress).show() If we didn't this example wouldn't update the progress bar until the callback finishes. However in implementing this we are not respecting the Websocket handlers write lock. I'll have to see if there's a good solution here. In the longer run we should certainly recommend an async approach to this but I'll see if there's a more short term fix I can make. In the worst case I could revert to locking as soon as a write lock is encountered, which would probably work for most computations where updates aren't triggered in very quick succession. |
I pushed my suggested fix up, it's really a bit of a hack but I think it's acceptable until we handle async functions properly. |
With the following environment on Windows 10...
...When I run the following script with
panel serve app.py --show
......I get the following errors in my browser console (tested both on Chrome and Firefox) after movie the slider for a while. The more I move it, the more errors come in.
While it doesn't affect so much this simple script, I believe this is the origin of an error I have in an app I'm developing, where the value of the
c
widget stops updating.The text was updated successfully, but these errors were encountered: