Skip to content

Commit

Permalink
Compare invocation namespaces when handling a cycle and recovering a …
Browse files Browse the repository at this point in the history
…queue (#5432)

* Compare invocation namespaces when handling a cycle and recovering a queue

* Temporarily enable upterm session for debugging

* Revert the upterm change
  • Loading branch information
style95 authored Aug 14, 2023
1 parent 54564cb commit 9371d62
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ class QueueManager(
}

case RecoverQueue(msg, action, actionMetaData) =>
QueuePool.keys.find(_.docInfo.id == action.toDocId) match {
QueuePool.keys.find(k =>
k.invocationNamespace == msg.user.namespace.name.asString && k.docInfo.id == action.toDocId) match {
// a newer queue is created, send msg to new queue
case Some(key) if key.docInfo.rev >= msg.revision =>
QueuePool.get(key) match {
Expand Down Expand Up @@ -326,7 +327,8 @@ class QueueManager(

private def handleCycle(msg: ActivationMessage)(implicit transid: TransactionId): Unit = {
val action = msg.action
QueuePool.keys.find(_.docInfo.id == action.toDocId) match {
QueuePool.keys.find(k =>
k.invocationNamespace == msg.user.namespace.name.asString && k.docInfo.id == action.toDocId) match {
// a newer queue is created, send msg to new queue
case Some(key) if key.docInfo.rev >= msg.revision =>
QueuePool.get(key) match {
Expand Down

0 comments on commit 9371d62

Please sign in to comment.