If this is reproducible, enable debug logging on your Notebook Server (`--log-level=DEBUG`) and reproduce your issue. Once disconnected, you should see log messages indicating that messages are being buffered. Upon re-connecting, you'll see a message that N messages are being discarded for a given value (i.e., key).
The issue is that the key used to determine if the buffered messages should be replayed is a connection-specific value and a new value is produced with each new connection. As a result, the value associated with the now current connection won't be found in the dictionary of buffered messages, so none of the messages relative to the previous (disconnected) connection will ever be replayed. I think the crux of the issue is locating a value that persists across "tab invocations" (i.e. connections) but isn't kernel-scoped because, apparently, a given kernel instance running from the same notebook server can have multiple connections simultaneously. Once replay is resolved within the server, there's a good chance that some set of changes in the front end will also be necessary. I know because I've modified the server to use a kernel-scoped key value so messages are replayed to the front-end, but they still don't appear. See Issue https://github.com/jupyter/notebook/issues/4105, and PRs https://github.com/jupyter/notebook/pull/2871 and https://github.com/jupyter/notebook/pull/4110. On Tuesday, October 23, 2018 at 11:20:27 PM UTC-7, [email protected] wrote: > > Hi all! > > I believe I am not alone in having trouble with Jupyter Notebooks that get > disconnected while the kernel is running and which refuse to reconnect. > > But today I saw a new twist; the notebook header shows "Disconnected" (and > pressing this button makes the notebook attempt to reconnect but fails). > However, a progress bar for a heavy task keeps updating, and the "Spark > Jobs" dialog also keep updating, and shows fresh progress every time I open > it. > > The Jupyter "overview" of running processes also shows the kernel as > active. So, obviously something is running, and the notebook is able to > update some of its items. So why do the header then shows "Not connected" > (and the "kernel icon" which is supposed to show whether the kernel is > running, idle, or disconnected, also shows "disconnected". Is this a known > bug? > > /kjell > -- You received this message because you are subscribed to the Google Groups "Project Jupyter" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/e40fdf00-e5af-4107-848a-409b6e040d1c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
