mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-22 17:16:20 +02:00
Bugfix/log exit code (#3362)
* log the exit code of the spawned task * exitcode can be negative * mypy fixes
This commit is contained in:
@@ -640,12 +640,16 @@ def connector_indexing_proxy_task(
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if job.status == "error":
|
if job.status == "error":
|
||||||
|
exit_code: int | None = None
|
||||||
|
if job.process:
|
||||||
|
exit_code = job.process.exitcode
|
||||||
task_logger.error(
|
task_logger.error(
|
||||||
"Indexing watchdog - spawned task exceptioned: "
|
"Indexing watchdog - spawned task exceptioned: "
|
||||||
f"attempt={index_attempt_id} "
|
f"attempt={index_attempt_id} "
|
||||||
f"tenant={tenant_id} "
|
f"tenant={tenant_id} "
|
||||||
f"cc_pair={cc_pair_id} "
|
f"cc_pair={cc_pair_id} "
|
||||||
f"search_settings={search_settings_id} "
|
f"search_settings={search_settings_id} "
|
||||||
|
f"exit_code={exit_code} "
|
||||||
f"error={job.exception()}"
|
f"error={job.exception()}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -82,7 +82,7 @@ class SimpleJob:
|
|||||||
return "running"
|
return "running"
|
||||||
elif self.process.exitcode is None:
|
elif self.process.exitcode is None:
|
||||||
return "cancelled"
|
return "cancelled"
|
||||||
elif self.process.exitcode > 0:
|
elif self.process.exitcode != 0:
|
||||||
return "error"
|
return "error"
|
||||||
else:
|
else:
|
||||||
return "finished"
|
return "finished"
|
||||||
@@ -123,7 +123,8 @@ class SimpleJobClient:
|
|||||||
self._cleanup_completed_jobs()
|
self._cleanup_completed_jobs()
|
||||||
if len(self.jobs) >= self.n_workers:
|
if len(self.jobs) >= self.n_workers:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"No available workers to run job. Currently running '{len(self.jobs)}' jobs, with a limit of '{self.n_workers}'."
|
f"No available workers to run job. "
|
||||||
|
f"Currently running '{len(self.jobs)}' jobs, with a limit of '{self.n_workers}'."
|
||||||
)
|
)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user