-
Notifications
You must be signed in to change notification settings - Fork 11
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
transfer log is opened on multiple file descriptors #191
Comments
Thanks for your message. If we execute the code linked below, which only creates a logger, we can observe the same kind of result with the following lsof Linux command. We can see a parent process (PID=8613) an a set of sub-processes (PID=8616, 8617, 8621, ...). In the documentation, we can read : "The logging module is intended to be thread-safe without any special work needing to be done by its clients. It achieves this though using threading locks; there is one lock to serialize access to the module’s shared data, and each handler also creates a lock to serialize access to its underlying I/O." (source : https://docs.python.org/3/library/logging.html) If you execute the lsof command with the file name : lsof /path/to/sdt_3.10a/log/transfer.log, you will see a single line as a response (sub-processes are hidden) In conclusion, we think that your use case is nominal and could not be really a problem. Patrice The code used for testing : import logging _log_format = "%(asctime)s - [%(levelname)s] - %(name)s - (%(filename)s).%(funcName)s(%(lineno)d) - %(message)s" def get_file_handler(): def get_logger(name): if name == 'main': |
Below is the output of
lsof
examining the synda daemon process (with details of local user/group/path names edited out). Thetransfer.log
is opened on 5 different file descriptors simultaneously. Could this be a problem?The text was updated successfully, but these errors were encountered: