mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-21 14:12:42 +02:00
add more debug logging for locking issue
This commit is contained in:
@@ -298,6 +298,15 @@ def check_for_indexing(self: Task, *, tenant_id: str | None) -> int | None:
|
|||||||
if search_settings_instance.id == search_settings_list[0].id:
|
if search_settings_instance.id == search_settings_list[0].id:
|
||||||
search_settings_primary = True
|
search_settings_primary = True
|
||||||
|
|
||||||
|
if tenant_id in debug_tenants:
|
||||||
|
ttl = redis_client.ttl(OnyxRedisLocks.CHECK_INDEXING_BEAT_LOCK)
|
||||||
|
task_logger.info(
|
||||||
|
f"check_for_indexing cc_pair should index: "
|
||||||
|
f"tenant={tenant_id} "
|
||||||
|
f"cc_pair={cc_pair_id} "
|
||||||
|
f"ttl={ttl}"
|
||||||
|
)
|
||||||
|
|
||||||
if not _should_index(
|
if not _should_index(
|
||||||
cc_pair=cc_pair,
|
cc_pair=cc_pair,
|
||||||
last_index=last_attempt,
|
last_index=last_attempt,
|
||||||
@@ -326,6 +335,15 @@ def check_for_indexing(self: Task, *, tenant_id: str | None) -> int | None:
|
|||||||
cc_pair.id, None, db_session
|
cc_pair.id, None, db_session
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if tenant_id in debug_tenants:
|
||||||
|
ttl = redis_client.ttl(OnyxRedisLocks.CHECK_INDEXING_BEAT_LOCK)
|
||||||
|
task_logger.info(
|
||||||
|
f"check_for_indexing cc_pair try_creating_indexing_task: "
|
||||||
|
f"tenant={tenant_id} "
|
||||||
|
f"cc_pair={cc_pair_id} "
|
||||||
|
f"ttl={ttl}"
|
||||||
|
)
|
||||||
|
|
||||||
# using a task queue and only allowing one task per cc_pair/search_setting
|
# using a task queue and only allowing one task per cc_pair/search_setting
|
||||||
# prevents us from starving out certain attempts
|
# prevents us from starving out certain attempts
|
||||||
attempt_id = try_creating_indexing_task(
|
attempt_id = try_creating_indexing_task(
|
||||||
@@ -346,6 +364,15 @@ def check_for_indexing(self: Task, *, tenant_id: str | None) -> int | None:
|
|||||||
)
|
)
|
||||||
tasks_created += 1
|
tasks_created += 1
|
||||||
|
|
||||||
|
if tenant_id in debug_tenants:
|
||||||
|
ttl = redis_client.ttl(OnyxRedisLocks.CHECK_INDEXING_BEAT_LOCK)
|
||||||
|
task_logger.info(
|
||||||
|
f"check_for_indexing cc_pair try_creating_indexing_task finished: "
|
||||||
|
f"tenant={tenant_id} "
|
||||||
|
f"cc_pair={cc_pair_id} "
|
||||||
|
f"ttl={ttl}"
|
||||||
|
)
|
||||||
|
|
||||||
# debugging logic - remove after we're done
|
# debugging logic - remove after we're done
|
||||||
if tenant_id in debug_tenants:
|
if tenant_id in debug_tenants:
|
||||||
ttl = redis_client.ttl(OnyxRedisLocks.CHECK_INDEXING_BEAT_LOCK)
|
ttl = redis_client.ttl(OnyxRedisLocks.CHECK_INDEXING_BEAT_LOCK)
|
||||||
|
Reference in New Issue
Block a user