Comments (1)
Thanks for your message.
Your observation is correct.
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.
$ lsof | grep "x.log"
python3.9 8613 username 6w REG 253,3 0 1077431087 path_to/x.log
python3.9 8613 8616 username 6w REG 253,3 0 1077431087 path_to/x.log
python3.9 8613 8617 username 6w REG 253,3 0 1077431087 path_to/x.log
python3.9 8613 8621 username 6w REG 253,3 0 1077431087 path_to/x.log
python3.9 8613 8622 username 6w REG 253,3 0 1077431087 path_to/x.log
python3.9 8613 8623 username 6w REG 253,3 0 1077431087 path_to/x.log
python3.9 8613 8624 username 6w REG 253,3 0 1077431087 path_to/x.log
python3.9 8613 8625 username 6w REG 253,3 0 1077431087 path_to/x.log
python3.9 8613 8626 username 6w REG 253,3 0 1077431087 path_to/x.log
python3.9 8613 8627 username 6w REG 253,3 0 1077431087 path_to/x.log
python3.9 8613 8628 username 6w REG 253,3 0 1077431087 path_to/x.log
We can see a parent process (PID=8613) an a set of sub-processes (PID=8616, 8617, 8621, ...).
In fact, it's the logging package implementation that creates these threads.
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.
However, the way that synda implements the logs at the moment will change. We want to enhance this part as soon as possible.
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():
file_handler = logging.FileHandler("x.log")
file_handler.setLevel(logging.WARNING)
file_handler.setFormatter(logging.Formatter(_log_format))
return file_handler
def get_logger(name):
logger = logging.getLogger(name)
logger.setLevel(logging.INFO)
logger.addHandler(get_file_handler())
return logger
if name == 'main':
logger = get_logger(name)
from synda.
Related Issues (20)
- synda remove fails to import sdsimplefilter HOT 2
- OAuth 2.0 authentication support needed for ESGF Future Architecture HOT 1
- Where can I find up to date documentation? HOT 4
- STAC ESGF Search Support for Synda
- Synda reports lots of failed checksums HOT 4
- Unable to change setting of data_path in Synda HOT 5
- synda daemon succefully started but download does not work HOT 3
- synda daemon and synda reset not responsive HOT 11
- Download not working when `wget` is installed outside standard locations
- "%" in password is interpreted as formatting operator
- `synda queue` disables cursor on MacOS
- conda openssl requirement HOT 1
- add support for username in credentials.conf
- Synda time slice in selection file breaks whenever a file has a bad name
- Synda reset marks failed file downloads as `already installed`
- downloads stops when almost complete HOT 1
- synda on conda-forge
- Daemon stopping immediately HOT 1
- Datasets still have the status of 'empty' despite all of their files having the status 'done'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from synda.