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 (apache#5432)

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

* Temporarily enable upterm session for debugging

* Revert the upterm change

(cherry picked from commit 9371d62)
  • Loading branch information
style95 authored and mtt-merz committed Oct 22, 2023
1 parent 40aad56 commit 01b357d
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 01b357d

Please sign in to comment.