SIP RA, sending messages from SLEE event handlers, low latency and rollback
Some time ago I had chat with Eduardo,Francesco and Louis from PTI on similar subject that this thread has.
Problem is that when we embed some stack (like sipra) we send messages/packets from SLEE event handlers. This introduces few problems that can complicate applications if they have to be fail safe on highest level ( or even not highest ) or RA/SLEE code:
* when we send reqeust we can receive response before SLEE tx that sent reqeust ends. This can cause concurrent acces to some resources, rollbacks, illegal state or race condition. For instance we send request, (stack has sent it), (stack received response), after send ra updates something/slee updates some state, but in the same time another tx does read that state - for response. Bad things can happen now.
* rollbacks of tx in wchich reqeust/packet was sent. what should happen in case then reqeust is disspatched and in next few lines of code runtimem exception is thrown and goes up to event router? Message was already sent, but state of service propably was not updated.
Idea is would be to move send invocations to after commit actions, propably along with object that should handle "send time" exceptions.
But thats a hack that possibly can double fire back into programmers face.
Any thoughts on that? Sollutions or experience?