mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-15 11:28:09 +00:00
update log messages to ease debugging (#988)
This commit is contained in:
@ -173,7 +173,8 @@ def on_worker_event_running(
|
|||||||
|
|
||||||
if task.state in TaskState.shutting_down():
|
if task.state in TaskState.shutting_down():
|
||||||
logging.info(
|
logging.info(
|
||||||
"ignoring task start from node. machine_id:%s %s:%s (state: %s)",
|
"ignoring task start from node. "
|
||||||
|
"machine_id:%s job_id:%s task_id:%s (state: %s)",
|
||||||
machine_id,
|
machine_id,
|
||||||
task.job_id,
|
task.job_id,
|
||||||
task.task_id,
|
task.task_id,
|
||||||
@ -182,7 +183,7 @@ def on_worker_event_running(
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
logging.info(
|
logging.info(
|
||||||
"task started on node. machine_id:%s %s:%s",
|
"task started on node. machine_id:%s job_id%s task_id:%s",
|
||||||
machine_id,
|
machine_id,
|
||||||
task.job_id,
|
task.job_id,
|
||||||
task.task_id,
|
task.task_id,
|
||||||
|
@ -236,7 +236,9 @@ class Task(BASE_TASK, ORMMixin):
|
|||||||
task.mark_failed(
|
task.mark_failed(
|
||||||
Error(
|
Error(
|
||||||
code=ErrorCode.TASK_FAILED,
|
code=ErrorCode.TASK_FAILED,
|
||||||
errors=["prerequisite task failed"],
|
errors=[
|
||||||
|
"prerequisite task failed. task_id:%s" % self.task_id
|
||||||
|
],
|
||||||
),
|
),
|
||||||
tasks_in_job,
|
tasks_in_job,
|
||||||
)
|
)
|
||||||
|
@ -232,7 +232,10 @@ class Node(BASE_NODE, ORMMixin):
|
|||||||
if error is None:
|
if error is None:
|
||||||
error = Error(
|
error = Error(
|
||||||
code=ErrorCode.TASK_FAILED,
|
code=ErrorCode.TASK_FAILED,
|
||||||
errors=["node reimaged during task execution"],
|
errors=[
|
||||||
|
"node reimaged during task execution. machine_id:%s"
|
||||||
|
% self.machine_id
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
for entry in NodeTasks.get_by_machine_id(self.machine_id):
|
for entry in NodeTasks.get_by_machine_id(self.machine_id):
|
||||||
|
@ -18,12 +18,14 @@ from ..onefuzzlib.tasks.scheduler import schedule_tasks
|
|||||||
def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa: F841
|
def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa: F841
|
||||||
expired_tasks = Task.search_expired()
|
expired_tasks = Task.search_expired()
|
||||||
for task in expired_tasks:
|
for task in expired_tasks:
|
||||||
logging.info("stopping expired task: %s", task.job_id)
|
logging.info(
|
||||||
|
"stopping expired task. job_id:%s task_id:%s", task.job_id, task.task_id
|
||||||
|
)
|
||||||
task.mark_stopping()
|
task.mark_stopping()
|
||||||
|
|
||||||
expired_jobs = Job.search_expired()
|
expired_jobs = Job.search_expired()
|
||||||
for job in expired_jobs:
|
for job in expired_jobs:
|
||||||
logging.info("stopping expired job: %s", job.job_id)
|
logging.info("stopping expired job. job_id:%s", job.job_id)
|
||||||
job.stopping()
|
job.stopping()
|
||||||
|
|
||||||
jobs = Job.search_states(states=JobState.needs_work())
|
jobs = Job.search_states(states=JobState.needs_work())
|
||||||
|
@ -346,10 +346,11 @@ class TestOnefuzz:
|
|||||||
# check if the task itself has an error
|
# check if the task itself has an error
|
||||||
if task.error is not None:
|
if task.error is not None:
|
||||||
self.logger.error(
|
self.logger.error(
|
||||||
"task failed: %s - %s (%s)",
|
"task failed: %s - %s (%s) - %s",
|
||||||
job.config.name,
|
job.config.name,
|
||||||
task.config.task.type.name,
|
task.config.task.type.name,
|
||||||
task.error,
|
task.error,
|
||||||
|
task.task_id,
|
||||||
)
|
)
|
||||||
return TaskTestState.failed
|
return TaskTestState.failed
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user