From 22fa593c92fcb42c940cf9afd1ade0c5c265213b Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Mon, 14 Aug 2023 14:48:13 +0000 Subject: [PATCH] Attempt to fix deadlocks by notifying separately for each id --- packages/cli/lib/net/queue.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/cli/lib/net/queue.dart b/packages/cli/lib/net/queue.dart index fb6457e0..32c3f4f9 100644 --- a/packages/cli/lib/net/queue.dart +++ b/packages/cli/lib/net/queue.dart @@ -240,9 +240,10 @@ class NetQueue { 'json': jsonEncode(request), }, ); + final requestId = result[0][0] as int; // TODO(eseidel): This could be a trigger. - await _db.connection.execute('NOTIFY request_'); - return result[0][0] as int; + await _db.connection.execute('NOTIFY request_, $requestId'); + return requestId; } /// Waits for a response to be available for the given request id, returning @@ -337,7 +338,7 @@ class NetQueue { }, ); // TODO(eseidel): This could be a trigger. - await _db.connection.execute('NOTIFY response_'); + await _db.connection.execute("NOTIFY response_, '${request.id}'"); } /// Waits for a notification that a new request is available.