Skip to content

Worker raises instead of exit with error #84

Description

@alexandrevicenzi

Function main_loop has this code:

try:
    log_file = conf.get("LOG_FILE", None)
    logger = logging.Logger("TaskManager")
    logger.setLevel(logging.DEBUG)
    if log_file:
        log_level = logging._levelNames.get(conf.get("LOG_LEVEL", "DEBUG").upper())
        kobo.log.add_rotating_file_logger(logger, log_file, log_level=log_level)

    tm = TaskManager(conf=conf, logger=logger)
except Exception as ex:
    raise
    sys.stderr.write("Error initializing TaskManager: %s\n" % ex)
    sys.exit(1)

If some exception occurs it's re-raised instead of executing the code above the raise line. This code is unreachable and it's difficult to know what should be the behavior.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions