Skip to content

Handle lack of a last result file at a worker hang #246

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

Merged
merged 2 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def process_file(filepath):
ctime = time.ctime(os.stat(filepath).st_mtime)
except Exception:
if not os.path.exists(filepath):
color_stdout('[File does not exists: {}]'.format(filepath),
color_stdout('[File does not exist: {}]\n'.format(filepath),
schema='error')
lines = []
ctime = time.ctime()
Expand Down
17 changes: 11 additions & 6 deletions listeners.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,23 +282,28 @@ def process_timeout(self, delta_seconds):
return

is_warning = self.inactivity < self.kill_timeout
color_schema = 'test_var' if is_warning else 'error'

color_stdout(
"No output during {0.inactivity:.0f} seconds. "
"Will abort after {0.kill_timeout:.0f} seconds without output. "
"List of workers not reporting the status:\n".format(self),
schema=('test_var' if is_warning else 'error'))
schema=color_schema)

hung_tasks = [task for worker_id, task
in self.worker_current_task.iteritems()
if worker_id in worker_ids]
for task in hung_tasks:
with open(task.task_tmp_result, 'r') as f:
lines = sum(1 for _ in f)
color_stdout("- {0} [{1}, {2}] at {3}:{4}\n".format(
result_file = task.task_tmp_result
result_file_summary = '(no result file {})'.format(result_file)
if os.path.exists(result_file):
with open(result_file, 'r') as f:
lines = sum(1 for _ in f)
result_file_summary = 'at {}:{}'.format(result_file,
lines)
color_stdout('- {} [{}, {}] {}\n'.format(
task.worker_name, task.task_name, task.task_param,
task.task_tmp_result, lines),
schema=('test_var' if is_warning else 'error'))
result_file_summary), schema=color_schema)

self.warned_seconds_ago = 0.0

Expand Down