Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
Removing stdout logging in local logger to avoid runbook getting stuc…
Browse files Browse the repository at this point in the history
…k on write method. (#858)

* Update locallogger.py

Bug 13865277: [CRI] automationrunbooktracer is hanging in automationrunbooktracer.log()
Local logging to stdout is causing write_nocancel method to block indefinitely when there is too much loffing into stdout
This logging is only used for debugging purpose, also the logs are getting redirected to runbook* and sandbox* files.
Commenting out local stdout logging to resolve this issue.

* Update locallogger.py

formatting changes

* Updating agent version to 1.7.10.0. Adding locallogger changes in 3.x/worker

Updating agent version to 1.7.10.0
Adding locallogger changes in 3.x/worker
  • Loading branch information
dmohanta authored Jun 10, 2022
1 parent d1c9ac9 commit 95ffae0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ endif

nxOMSAutomationWorker:
rm -rf output/staging; \
VERSION="1.7.9.0"; \
VERSION="1.7.10.0"; \
PROVIDERS="nxOMSAutomationWorker"; \
STAGINGDIR="output/staging/$@/DSCResources"; \
cat Providers/Modules/$@.psd1 | sed "s@<MODULE_VERSION>@$${VERSION}@" > intermediate/Modules/$@.psd1; \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
DEFAULT_VM_ID = DEFAULT_UNKNOWN
DEFAULT_WORKER_TYPE = DEFAULT_UNKNOWN
DEFAULT_COMPONENT = DEFAULT_UNKNOWN
DEFAULT_WORKER_VERSION = "1.7.9.0"
DEFAULT_WORKER_VERSION = "1.7.10.0"
DEFAULT_JRDS_POLLING_FREQUENCY = "15"

# state configuration keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,21 @@ def init_logger():
default_rf_handler.setFormatter(formatter)
default_logger.addHandler(default_rf_handler)


# Stdout handler (Worker traces have to be formatted).
#log_stream = logging.StreamHandler(sys.stdout)
#log_stream.setFormatter(formatter)
#default_logger.addHandler(log_stream)

# Stdout handler (traces coming from child process are already formatted).
#sandbox_log_stream = logging.StreamHandler(sys.stdout)
#sandbox_stdout.addHandler(sandbox_log_stream)

# Traces coming from sandbox child process and collected by the worker are already formatted, hence no formatter
# needed.
worker_sandbox_rf_handler = logging.handlers.RotatingFileHandler(file_name, maxBytes=10485760, backupCount=5)
sandbox_stdout.addHandler(worker_sandbox_rf_handler)

# Stdout handler (Worker traces have to be formatted).
log_stream = logging.StreamHandler(sys.stdout)
log_stream.setFormatter(formatter)
default_logger.addHandler(log_stream)

# Stdout handler (traces coming from child process are already formatted).
sandbox_log_stream = logging.StreamHandler(sys.stdout)
sandbox_stdout.addHandler(sandbox_log_stream)


def log_warning(message):
if default_logger is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
DEFAULT_VM_ID = DEFAULT_UNKNOWN
DEFAULT_WORKER_TYPE = DEFAULT_UNKNOWN
DEFAULT_COMPONENT = DEFAULT_UNKNOWN
DEFAULT_WORKER_VERSION = "1.7.9.0"
DEFAULT_WORKER_VERSION = "1.7.10.0"
DEFAULT_JRDS_POLLING_FREQUENCY = "15"

# state configuration keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
DEFAULT_VM_ID = DEFAULT_UNKNOWN
DEFAULT_WORKER_TYPE = DEFAULT_UNKNOWN
DEFAULT_COMPONENT = DEFAULT_UNKNOWN
DEFAULT_WORKER_VERSION = "1.7.9.0"
DEFAULT_WORKER_VERSION = "1.7.10.0"
DEFAULT_JRDS_POLLING_FREQUENCY = "15"

# state configuration keys
Expand Down

0 comments on commit 95ffae0

Please sign in to comment.