Service: Weirdness sending a trigger from Control class inside a service. #18
Labels
No labels
bug
confirmed
critical
discussion
documentation
Doing
enhancement
suggestion
support
To Do
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: hazaar/hazaar-warlock#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I have a weird situation that is triggered by some shared code using a Warlock\Control object. Basically, this happens:
\Application\Model\Request
.\Hazaar\Warlock\Control
object.In this case, the trigger sent by the request object using the Control class is sent, but never actioned.
Now for the weirdness. If the service does not send the final trigger, the trigger from the Request object is processed fine.
WHAT.....THE.....F$#@.....??????
I think this may have something to do with the
echo_self
parameter in triggers.Take the following service:
We will see the
___START___
line in the log output, but thetestTrigger()
method is never triggered.Hmmm... Could be a command sequence issue. When sending a trigger, the sender expects an OK response to let it know the world is a happy place. However when sending a trigger we are processing the even queue as soon as possible, which as it turns out, is BEFORE we send the OK. So, if the command is being echoed, we send the EVENT packet before we send the OK, then after the queue is processed we send the OK. So because the sender is expecting an OK, when it receives the EVENT it takes that as "not OK", doesn't process it as an EVENT and handles it as a failed trigger. Makes sense!
So, I have moved the queue processing call to AFTER the OK is sent and the above test trigger is working. Now we will test again in our live environment to see if this was the issue.
mentioned in commit
e33ff40791
mentioned in commit
34e5b8bc0f
I think I have figured it out!!!! This is all happening because there is an EVENT packet sitting in the receive buffer BEFORE we try and send a TRIGGER. So once the TRIGGER is sent, the first thing we get is EVENT which is handled as a "not OK" response.
Things to try:
I have gone with option 2, ditch the OK. Turns out that SYNC and TRIGGER are the only transmissions that waited for an OK. SYNC still requires it as it is what initiates the client connection and sends the client ID. Everything else can just send blindly. If we are still losing things and want send retries, we can later implement a packet out-queue with send IDs and require responses.
closed via commit
14044cf012