From 71165b1fe70ba89d0323b32c686c2863dec25af7 Mon Sep 17 00:00:00 2001 From: QiuSW <105186638@qq.com> Date: Tue, 13 Oct 2026 09:22:04 +0800 Subject: [PATCH] fix(android): drop object lock on diagnostic record to avoid deadlock (#386) AgentDiagnosticStore.record() held the helper monitor (@Synchronized) while waiting for the SQLite write connection, while failure-snapshot and sync diagnostic transactions held the connection and re-entered getWritableDatabase() (same monitor). The inverted lock order deadlocked and blocked the sync/heartbeat thread forever (seen on purchase device 1). record() only touches locals inside its own transaction and is called from a single-thread executor, so the monitor is unnecessary. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NTDbDcwbDw1TSAcE6wfh2F --- .../cn/ilapage/goauto/agent/persistence/AgentDiagnosticStore.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/android/app/src/main/java/cn/ilapage/goauto/agent/persistence/AgentDiagnosticStore.kt b/android/app/src/main/java/cn/ilapage/goauto/agent/persistence/AgentDiagnosticStore.kt index fbf909c..da2761f 100644 --- a/android/app/src/main/java/cn/ilapage/goauto/agent/persistence/AgentDiagnosticStore.kt +++ b/android/app/src/main/java/cn/ilapage/goauto/agent/persistence/AgentDiagnosticStore.kt @@ -166,7 +166,6 @@ class AgentDiagnosticStore(context: Context) : SQLiteOpenHelper(context, DATABAS } } - @Synchronized fun record(event: AgentDiagnosticEvent) { require(event.taskId > 0) require(event.taskType in setOf("collection", "purchase"))