Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite objects created in a thread Exception #790

Closed
Zsailer opened this issue Apr 14, 2022 · 1 comment · Fixed by #792
Closed

SQLite objects created in a thread Exception #790

Zsailer opened this issue Apr 14, 2022 · 1 comment · Fixed by #792
Labels

Comments

@Zsailer
Copy link
Member

Zsailer commented Apr 14, 2022

Seeing the following exception periodically in the tests.

For example, see this failed test action: https://github.com/jupyter-server/jupyter_server/runs/6027513680?check_suite_focus=true

Test name is: test_modify_path[jp_server_config2]

  Traceback (most recent call last):
    File "/home/runner/work/jupyter_server/jupyter_server/sdist/test/jupyter_server/services/sessions/sessionmanager.py", line 227, in __del__
      self.close()
    File "/home/runner/work/jupyter_server/jupyter_server/sdist/test/jupyter_server/services/sessions/sessionmanager.py", line 222, in close
      self._cursor.close()
  sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 140546998728512 and this is thread id 140545254971136.
@Zsailer Zsailer added the bug label Apr 14, 2022
@bollwyvl
Copy link
Contributor

Perhaps the jp_serverapp fixture (and maybe others) should close the session_manager (and maybe more things)?

@pytest.fixture(scope="function")
def jp_serverapp(jp_ensure_app_fixture, jp_server_config, jp_argv, jp_configurable_serverapp):
    """Starts a Jupyter Server instance based on the established configuration values."""
    app = jp_configurable_serverapp(config=jp_server_config, argv=jp_argv)
    yield app
    app.remove_server_info_file()
    app.remove_browser_open_files()
    app.session_manager.close() # like this, but maybe more stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants