Skip to content
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

Debug level is not propagated to service threads #115

Open
BorjaEst opened this issue May 30, 2023 · 1 comment
Open

Debug level is not propagated to service threads #115

BorjaEst opened this issue May 30, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@BorjaEst
Copy link

BorjaEst commented May 30, 2023

Description

Logger output on predict and train functions with lower level than WARN is not printed on stderr.

Steps to Reproduce

  1. Download demo_app (or any other use case).
  2. Create a logger in the api module and log in get_meatada and predict using debug, for example:
import logging
logger = logging.getLogger(__name__)

def get_metadata():
    logger.debug("Some debug information")
    return {"status": "All ok, debug was printed"}

def get_predict_args():
    return {}

def predict(**kwargs):
    logger.debug("Some debug information")
    return {"status": "Debug was not printed"}
  1. Create a configuration file which set debug level to "DEBUG" (./deepaas.conf):
[DEFAULT]
debug = true
log_date_format = %Y-%m-%d %H:%M:%S
  1. Run using the confg file: deepaas-run --config-file deepaas.conf

Expected behavior:

When calling predict / train method, debug information should be printed.
(like in ´get_metadata`)

Actual behavior

Only logger print levels higher or equal than WARN are printed on predict / train method.

Versions

$ deepaas-run --version
2.1.0

Extra information

I see the functions predict and train are executed by workers. However, the logger level at those workers seems to not be inherited from the original logger level.

@alvarolopez alvarolopez added the bug Something isn't working label Jun 21, 2023
@BorjaEst
Copy link
Author

@IgnacioHeredia, I think this issue is related to what we spoke today. I was testing with @vykozlov and there might be a race condition somewhere:

  • Starting with --debug and no config, prints debug info at the beginning but not from methods.
  • Starting without --debug but config, does not print debug at the beginning but does for methods.

Also, when I created this issue, I was testing with the config and not with --debug, it might happen that aiohttp does not propagate logger to workers if arg --debug is not set? Not sure how much is worth value to investigate if a new version is comming with different web framework.

@alvarolopez alvarolopez removed this from the 3.0.0 - Improve model loading milestone Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants