Removing Envs is buggy
da-h opened this issue · comments
David Hartmann commented
Bug Description
- When removing an
env
in the "Environment Management Modal" visdom will crash if theenv
has not been saved explicitly. - Removing an active
env
results in a state where noenv
is selected, but all windows of the removedenv
are still visible.
As a side note: One could put the os.remove
into a try
/catch
-block, but with the second issue above, it seems this should be caught before that. Possibly there is a flag missing somewhere in the call chain that specifies if the env
actually exists as a file or only in memory.
Reproduction Steps
See #886: The test cypress/integration/modal.js
contains two TODO
s that reproduce those issues repeatable.
Expected behavior
All windows should be cleared when removing the active env
, also the visdom client should not crash when closing any env
.
Server logs:
INFO:tornado.access:200 POST /env/text_fork_561637 (127.0.0.1) 0.72ms
INFO:root:from web client: {"cmd":"delete_env","prev_eid":"text_fork_561637","eid":"text_fork_561637_fork"}
INFO:root:closing environment text_fork_561637_fork
INFO:root:from web client: {"cmd":"delete_env","prev_eid":"text_fork_561637","eid":"text_fork_561637"}
INFO:root:closing environment text_fork_561637
ERROR:tornado.application:Uncaught exception GET /socket (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:8098', method='GET', uri='/socket', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
File "/home/da-h/.pyenv/versions/3.8.13/lib/python3.8/site-packages/tornado/websocket.py", line 635, in _run_callback
result = callback(*args, **kwargs)
File "/home/da-h/Projects/visdom/py/visdom/server/handlers/socket_handlers.py", line 264, in on_message
os.remove(p)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/testdir/text_fork_561637.json'