callfork: Fix error propagation
If all fork children fail before any channel can be created, the fork will always fail with error code 500. However, we can have such a situation because all participants are offline and the routing returns the respective error code. In order to mitigate this, we update the error code of the call.execute message of the fork. So, in the case that all children fail before any channel can be established, the caller will see the error code of the last child. In an all-offline scenario this would be 404.
This commit is contained in:
parent
6fa07fb632
commit
bdaa62cd1e
|
@ -323,6 +323,8 @@ bool ForkMaster::forkSlave(String* dest)
|
|||
Debug(this,DebugAll,"Call '%s' target '%s' slave '%s' execute succeeded with no peer [%p]",
|
||||
getPeerId().c_str(),dest->c_str(),tmp.c_str(),this);
|
||||
ok = false;
|
||||
// error propagation via lostMaster() does not work in this case. No channel was created, hence no messages are created
|
||||
m_exec->setParam("error", error);
|
||||
slave->lostMaster(error);
|
||||
}
|
||||
slave->deref();
|
||||
|
|
Loading…
Reference in New Issue