Giter Club home page Giter Club logo

Comments (5)

MarcSkovMadsen avatar MarcSkovMadsen commented on June 8, 2024

I tried adding a try except. But the I started seeing other mysterious exception.

I removed the try except again.

from panel.

MarcSkovMadsen avatar MarcSkovMadsen commented on June 8, 2024

When having multiple windows open and reloading one of them I also see

2024-04-21 07:27:21,401 Error running application handler <panel.io.handlers.ScriptHandler object at 0x0000019460880150>: Script at 'C:\repos\private\panel\script.py' replaced the output document
File 'handlers.py', line 258, in post_check:
raise RuntimeError("%s at '%s' replaced the output document" % (handler._origin, handler._runner.path)) Traceback (most recent call last):
  File "c:\repos\private\panel\panel\io\handlers.py", line 389, in run
    post_check()
  File "c:\repos\private\panel\panel\io\handlers.py", line 258, in post_check
    raise RuntimeError("%s at '%s' replaced the output document" % (handler._origin, handler._runner.path))
RuntimeError: Script at 'C:\repos\private\panel\script.py' replaced the output document

2024-04-21 07:27:21,494 WebSocket connection closed: code=1001, reason=None
2024-04-21 07:27:21,528 Failed sending message as connection was closed
2024-04-21 07:27:21,530 WebSocket connection opened
2024-04-21 07:27:21,568 ServerConnection created
2024-04-21 07:27:51,074 Error running application handler <panel.io.handlers.ScriptHandler object at 0x0000019460880150>: _pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes
File 'session.py', line 244, in _document_patched:
raise RuntimeError("_pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes") Traceback (most recent call last):
  File "c:\repos\private\panel\panel\io\handlers.py", line 386, in run
    exec(self._code, module.__dict__)
  File "C:\repos\private\panel\script.py", line 186, in <module>
    stream.servable()
  File "c:\repos\private\panel\panel\viewable.py", line 1054, in servable
    return self._create_view().servable(title, location, area, target)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\repos\private\panel\panel\viewable.py", line 395, in servable
    self.server_doc(title=title, location=location) # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\repos\private\panel\panel\viewable.py", line 1011, in server_doc
    add_to_doc(model, doc)
  File "c:\repos\private\panel\panel\io\model.py", line 118, in add_to_doc
    doc.add_root(obj)
  File "C:\repos\private\panel\.venv\Lib\site-packages\bokeh\document\document.py", line 324, in add_root
    self.callbacks.trigger_on_change(RootAddedEvent(self, model, setter))
  File "C:\repos\private\panel\.venv\Lib\site-packages\bokeh\document\callbacks.py", line 413, in trigger_on_change
    invoke_with_curdoc(doc, invoke_callbacks)
  File "C:\repos\private\panel\.venv\Lib\site-packages\bokeh\document\callbacks.py", line 443, in invoke_with_curdoc
    return f()
           ^^^
  File "C:\repos\private\panel\.venv\Lib\site-packages\bokeh\document\callbacks.py", line 412, in invoke_callbacks
    cb(event)
  File "C:\repos\private\panel\.venv\Lib\site-packages\bokeh\document\callbacks.py", line 276, in <lambda>
    self._change_callbacks[receiver] = lambda event: event.dispatch(receiver)
                                                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\repos\private\panel\.venv\Lib\site-packages\bokeh\document\events.py", line 219, in dispatch
    cast(DocumentPatchedMixin, receiver)._document_patched(self)
  File "C:\repos\private\panel\.venv\Lib\site-packages\bokeh\server\session.py", line 244, in _document_patched
    raise RuntimeError("_pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes")
RuntimeError: _pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes

from panel.

MarcSkovMadsen avatar MarcSkovMadsen commented on June 8, 2024

Also if I have a large number of windows open (4), set the fps high (60) and the min_sleep low (0.1). I can also be hard to pause the camera via the checkbox. The camera loop just keeps running for a long time sending the frames to the frontend

Later it sends the paused checkbox to all the open windows and pauses the video.

stream=ServerVideoStream(fps=60, camera_index=1, min_sleep=0.1, paused=False, log_level=logging.WARNING)

Its like the separate thread loop is preferred over the main thread.

from panel.

philippjfr avatar philippjfr commented on June 8, 2024

When having multiple windows open and reloading one of them I also see

That's a little scary and needs a new issue. It's likely something to do with the threads.

from panel.

philippjfr avatar philippjfr commented on June 8, 2024

Also if I have a large number of windows open (4), set the fps high (60) and the min_sleep low (0.1). I can also be hard to pause the camera via the checkbox.

We can consider somehow throttling events, the problem here is that you're effectively queuing up a bunch of events that have to be sent across the websocket and they all pile up. So even when you turn off the spigot the backlog still needs to be processed.

from panel.

Related Issues (20)

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.