Skip to content

Conversation

@minrk
Copy link
Member

@minrk minrk commented Jul 31, 2023

loop.add_callback(loop.stop) called before the thread starts can get consumed by the run_sync before loop.start, so it won't close the loop. This is causing some tests to hang (e.g. ipython downstream tests), but isn't likely to affect any users at runtime.

The run_sync was added in #1125

loop.add_callback(loop.stop) called before the thread starts
can get consumed by the run_sync before loop.start,
so it won't close the loop.
Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@blink1073 blink1073 enabled auto-merge (squash) July 31, 2023 10:30
@blink1073
Copy link
Contributor

Hmm it looks like this failure is related, it happened twice in a row:

  FAILED ipykernel/inprocess/tests/test_kernelmanager.py::InProcessKernelManagerTestCase::test_interface - pytest.PytestUnhandledThreadExceptionWarning: Exception in thread IOPub
  
  Traceback (most recent call last):
    File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
      self.run()
    File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/threading.py", line 975, in run
      self._target(*self._args, **self._kwargs)
    File "/home/runner/work/ipykernel/ipykernel/sdist/test/ipykernel/iostream.py", line 98, in _thread_main
      self.io_loop.run_sync(_cancel)
    File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/tornado/ioloop.py", line 526, in run_sync
      raise TimeoutError("Operation timed out after %s seconds" % timeout)
  TimeoutError: Operation timed out after None seconds

@blink1073 blink1073 changed the title avoid starting IOPub background thread after it's been stopped Avoid starting IOPub background thread after it's been stopped Sep 2, 2023
@blink1073 blink1073 merged commit ca79e2e into ipython:main Sep 2, 2023
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 this pull request may close these issues.

2 participants