Skip to content

Commit

Permalink
Attempt to fix deadlocks by notifying separately for each id
Browse files Browse the repository at this point in the history
  • Loading branch information
eseidel committed Aug 14, 2023
1 parent e166337 commit 22fa593
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/cli/lib/net/queue.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 22fa593

Please sign in to comment.