pinecone-io / VSB

Vector Search Benchmarking suite
MIT License
3 stars 0 forks source link

[Bug] ValueError: operation on destroyed loop on shutdown #177

Open daverigby opened 4 months ago

daverigby commented 4 months ago

Is this a new bug?

Current Behavior

When running vsb workload mnist-test against pinecone on macOS using python3.12, an exception was thrown at the end of the run (after summary stats were printed).

Expected Behavior

A clean shutdown occurs

Steps To Reproduce

  1. On macOS (@brickj could you confirm version?) with python3.12 from homebrew:
  2. vsb --database=pinecone --workload=mnist-test --pinecone_api_key=

Relevant log output

2024-07-10T12:19:51 INFO     Saved stats to 'reports/pinecone/2024-07-10T12:19:23/stats.json'
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/weakref.py", line 666, in _exitfunc
    f()
  File "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/weakref.py", line 590, in __call__
    return info.func(*info.args, **(info.kwargs or {}))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rick/IdeaProjects/VSB/venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 1180, in _close_pool_connections
    conn.close()
  File "/Users/rick/IdeaProjects/VSB/venv/lib/python3.12/site-packages/urllib3/connection.py", line 275, in close
    super().close()
  File "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1020, in close
    sock.close()   # close it manually... there may be other refs
    ^^^^^^^^^^^^
  File "/Users/rick/IdeaProjects/VSB/venv/lib/python3.12/site-packages/gevent/_socket3.py", line 331, in close
    self._real_close()
  File "/Users/rick/IdeaProjects/VSB/venv/lib/python3.12/site-packages/gevent/ssl.py", line 717, in _real_close
    socket._real_close(self)
  File "/Users/rick/IdeaProjects/VSB/venv/lib/python3.12/site-packages/gevent/_socket3.py", line 324, in _real_close
    self._detach_socket('closed')
  File "/Users/rick/IdeaProjects/VSB/venv/lib/python3.12/site-packages/gevent/_socket3.py", line 315, in _detach_socket
    self._drop_events_and_close(closefd=(reason == 'closed'))
  File "/Users/rick/IdeaProjects/VSB/venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 466, in _drop_events_and_close
    hub.cancel_waits_close_and_then(
  File "src/gevent/_hub_primitives.py", line 75, in gevent._gevent_c_hub_primitives.WaitOperationsGreenlet.cancel_waits_close_and_then
  File "src/gevent/libev/corecext.pyx", line 1059, in gevent.libev.corecext.watcher.close
  File "src/gevent/libev/corecext.pyx", line 1015, in gevent.libev.corecext.watcher.stop
  File "src/gevent/libev/corecext.pyx", line 280, in gevent.libev.corecext._check_loop
ValueError: operation on destroyed loop


### Environment

_No response_

### Additional Context

_No response_
jonathanzxu commented 4 months ago

Can't reproduce, but error seems to have something to do with running queries in a gevent child process (e.g. Locust User) (see https://groups.google.com/a/lists.datastax.com/g/python-driver-user/c/XVicwbCxtiM). How frequently does this happen? @brickj

daverigby commented 3 months ago

I just got a reproduction of this.

2024-08-06T11:36:42 INFO Saved stats to 'reports/pinecone/2024-08-06T11:36:09/stats.json'
Traceback (most recent call last): File "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/weakref.py", line 666, in _exitfunc f() File "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/weakref.py", line 590, in call return info.func(*info.args, **(info.kwargs or {})) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/dave/repos/pinecone-io/VSB/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 1180, in _close_pool_connections conn.close() File "/Users/dave/repos/pinecone-io/VSB/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 275, in close super().close() File "/opt/homebrew/Cellar/python@3.12/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/http/client.py", line 1020, in close sock.close() # close it manually... there may be other refs ^^^^^^^^^^^^ File "/Users/dave/repos/pinecone-io/VSB/.venv/lib/python3.12/site-packages/gevent/_socket3.py", line 331, in close self._real_close() File "/Users/dave/repos/pinecone-io/VSB/.venv/lib/python3.12/site-packages/gevent/ssl.py", line 717, in _real_close socket._real_close(self) File "/Users/dave/repos/pinecone-io/VSB/.venv/lib/python3.12/site-packages/gevent/_socket3.py", line 324, in _real_close self._detach_socket('closed') File "/Users/dave/repos/pinecone-io/VSB/.venv/lib/python3.12/site-packages/gevent/_socket3.py", line 315, in _detach_socket self._drop_events_and_close(closefd=(reason == 'closed')) File "/Users/dave/repos/pinecone-io/VSB/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 466, in _drop_events_and_close hub.cancel_waits_close_and_then( File "src/gevent/_hub_primitives.py", line 75, in gevent._gevent_c_hub_primitives.WaitOperationsGreenlet.cancel_waits_close_and_then File "src/gevent/libev/corecext.pyx", line 1059, in gevent.libev.corecext.watcher.close File "src/gevent/libev/corecext.pyx", line 1015, in gevent.libev.corecext.watcher.stop File "src/gevent/libev/corecext.pyx", line 280, in gevent.libev.corecext._check_loop ValueError: operation on destroyed loop



However, running the exact same command again _didn't_ fail, so this is an intermittent issue.