Closed Bug 1120375 Opened 11 years ago Closed 10 years ago

Consider splitting the "timeout" reason of the websocket into multiple reasons

Categories

(Hello (Loop) :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX
backlog tech-debt

People

(Reporter: standard8, Unassigned)

References

Details

Currently, the "timeout" reason of the websocket can be for multiple reasons. The documentation is here: https://docs.services.mozilla.com/loop/apis.html#termination-reasons When we look at the code and the websocket state, a reason of timeout could mean: - "user unavailable" -- no response from their browser after a push notification -- no response from the user when being alerted - "media fail timeout" -- The call state failed to progress from connecting to connected within a reasonable time - i.e. media failed to be set up in a timely fashion The problem with a generic "timeout" reason is that it means the code has to detect the previous state and determine the real reason (e.g. this would help with fixing bug 1119992). It also means that in logging, we have to do log analysis to work out which state the timeout applies to (bug 1119574). I would propose that we separate these out, to something like: - "timeout-initial-contact" - "timeout-accept" - "timeout-connect" Adam, what do you think about this? If we do want to go ahead, then I can file extra bugs to update the various parts of Hello.
Flags: needinfo?(adam)
Yes it could make sense to do so.
(In reply to Mark Banner (:standard8) from comment #0) > - "timeout-initial-contact" > - "timeout-accept" > - "timeout-connect" > > Adam, what do you think about this? I think it would make more sense to instead include a "state" field in the server-to-client "progress" messages. That would allow recipients (and log processors) to make this kind of determination more cleanly. In this scheme, your three proposed events become: - "timeout-initial-contact" : timeout / init - "timeout-accept" : timeout / alerting - "timeout-connect" : timeout / connecting (and timeout / half-connected) One key reason I like this design better than exploding timeout event names to indicate event *and* state is that it scales into other events (both existing ones as well as future ones). If, for example, we started to see a lot of "connection-failure" events, this design covers it without any further modification. Rolling state names into the event would require new "connection-failure-initial-contact", "connection-failure-accept", and "connection-failure-connect" events.
Flags: needinfo?(adam)
Sorry, to be clear, I meant that we should include a "previous state" field in these messages: { "messageType":"progress", "state":"terminated", "reason":"timeout", "previousState":"alerting" }
blocking-38? because this is blocking other bugs that we want to uplift. I suspect this also wants to be a P1.
backlog: --- → tech-debt
See Also: → 1124381
Tagging Mark and Remy for feedback on my proposal.
Flags: needinfo?(standard8)
Flags: needinfo?(rhubscher)
It works for me.
Flags: needinfo?(rhubscher)
Yes, this seems to be fine.
Flags: needinfo?(standard8)
We're no longer using websockets
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.