Skip to content

Conversation

@limwz01
Copy link

@limwz01 limwz01 commented Dec 12, 2024

In order to support proper execution after resuming from an embedded kernel, we have to make sure that we can revert the IO alterations by the kernelapp using the close() method. The following fixes were made:

  • Call close before embed returns
  • Don't write the extra character on OutStream close() to pipe for watching thread if it's already dead or missing
  • Add new variable closed so that "close" can be called multiple times without any error
  • Don't use __stdout__ and __stderr__ at all
  • Keep blackhole reference around so that the watching thread's pipe file descriptors do not get accidentally closed when the object is garbage collected (it happens now because it is not stored in __stdout__)
  • Keep old IO variables and restore them when exiting
  • More robust StreamHandler fixup and restore (but I think these should actually be completely removed)

Fixes #1283

@limwz01
Copy link
Author

limwz01 commented Dec 12, 2024

Fixes #1283

@limwz01
Copy link
Author

limwz01 commented Dec 18, 2024

I have no idea why the tests are failing and I currently do not have the appropriate python version to run the tests. But I'll work on it.

@limwz01
Copy link
Author

limwz01 commented Dec 19, 2024

ok it's all fixed

@minrk minrk merged commit 180dd4f into ipython:main Feb 13, 2025
30 of 34 checks passed
@minrk
Copy link
Member

minrk commented Feb 13, 2025

Thank you!

@Carreau Carreau added this to the 7.0 milestone Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleanup file descriptors watcher thread

3 participants