binderhub icon indicating copy to clipboard operation
binderhub copied to clipboard

eventsource continues launching more containers if left open

Open rgbkrk opened this issue 6 years ago • 4 comments

If you leave the eventsource open after "ready" it continues launching more

Reproduction steps:

  • Visit about:blank
  • Open DevTools Console
  • Paste:
es = new window.EventSource('https://mybinder.org/build/gh/nteract/vdom/master')
es.onmessage = msg => console.log(msg)
  • wait...
  • watch all the successive launches

Not a crazy deal for me, I just happened to notice while hitting the event source API directly. My current code does a .close appropriately. Figured this should probably be cleaned up though.

rgbkrk avatar Nov 29 '17 22:11 rgbkrk

I think we just got burned by this with the nbinteract repository. @rgbkrk did you figure out a way to work around this from your side of things?

choldgraf avatar Apr 17 '18 00:04 choldgraf

Yeah, we .close() the event source after we get a freshly baked container. It wasn't an issue at the time, it just smelled like a likely operational problem waiting to happen.

rgbkrk avatar Apr 17 '18 17:04 rgbkrk

it just smelled like a likely operational problem waiting to happen.

choldgraf avatar Apr 17 '18 17:04 choldgraf

Is this still a problem?

manics avatar Sep 20 '21 18:09 manics