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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NTDbDcwbDw1TSAcE6wfh2F
This commit is contained in:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user