Skip to content

Change the logger's configuration to be more resilient #66

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

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

kgodlewski
Copy link
Contributor

Previously we configured loggers separately in multiple processes. This caused problems with logging to files and exceptions about closed filedescriptors appearing randomly from time to time.

The core part is having separate initialization methods for main and child processes, and passing a shared multiprocessing.Queue, which is used for logging, to SyncProcess.

Summary of the changes:

  • Use QueueHandler in child processes, paired with QueueListener in the main process
  • Make sure initializing multiple Runs in a single process does not break the logger
  • Make sure importing other neptune libs (like neptune-fetcher) does not break logging

* Use `QueueHandler` in child processes, paired with `QueueListener` in
  the main process
* Make sure initializing multiple Runs in a single process does not
  break the logger
* Make sure importing other neptune libs (like neptune-fetcher) does not
  break logging
@kgodlewski kgodlewski changed the title Change the logger's configuration Change the logger's configuration to be more resilient Oct 29, 2024
@PatrykGala PatrykGala merged commit 5dee65d into main Oct 31, 2024
4 checks passed
@PatrykGala PatrykGala deleted the kg/fix-logger branch October 31, 2024 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants