Giter VIP home page Giter VIP logo

Comments (6)

itsjafer avatar itsjafer commented on June 10, 2024

This is a difficult error to debug; the kernel extension is complaining that the Scala Listener has no comms; this is usually because the listener wasn't able to find a Spark Instance.

One solution might be to restart your kernel and refresh the page when you encounter this. I've found that sometimes installing the extension on a kernel that was previously running can result in some wonky errors that are simply fixed by a simply stop and start of the kernel and a refresh of the page.

from jupyterlab-sparkmonitor.

metasim avatar metasim commented on June 10, 2024

I'm also having this problem. @samj1912 Figure anything out?

from jupyterlab-sparkmonitor.

metasim avatar metasim commented on June 10, 2024

I note it happens even when the extension is loaded directly from the notebook (in lieu of kernel initialization):

image

from jupyterlab-sparkmonitor.

metasim avatar metasim commented on June 10, 2024

Extension thinks its loaded:

image

from jupyterlab-sparkmonitor.

metasim avatar metasim commented on June 10, 2024

So my current read is that register_comm is begin called, but the self.target_func callback isn't being called before comm is being dereferenced in send.

def register_comm(self):
"""Register a comm_target which will be used by
frontend to start communication."""
self.ipython.kernel.comm_manager.register_target(
'SparkMonitor', self.target_func)

from jupyterlab-sparkmonitor.

footplus avatar footplus commented on June 10, 2024

It can be worked around by checking if the frontend has already connected or not when using the comm object. It might be interesting to queue messages maybe ?

I suspect #18 is an other manifestation of this thread crash (but from the Spark listener side).

diff --git a/sparkmonitor/kernelextension.py b/sparkmonitor/kernelextension.py
index 6a94f5e..fbf3c04 100644
--- a/sparkmonitor/kernelextension.py
+++ b/sparkmonitor/kernelextension.py
@@ -41,6 +41,7 @@ class ScalaMonitor:
         ipython is the instance of ZMQInteractiveShell
         """
         self.ipython = ipython
+        self.comm = None

     def start(self):
         """Creates the socket thread and returns assigned port"""
@@ -53,7 +54,8 @@ class ScalaMonitor:

     def send(self, msg):
         """Send a message to the frontend"""
-        self.comm.send(msg)
+        if self.comm:
+            self.comm.send(msg)

     def handle_comm_message(self, msg):
         """Handle message received from frontend

from jupyterlab-sparkmonitor.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.