-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CHA-RL1h5 doesn’t respect operation atomicity #253
Comments
@lawrence-forooghian there is ambiguity around how channel-windown works when room gets into |
I went through the chat-js behaviour and noted down few discrepancies => ably/ably-chat-js#405 (comment) |
The conclusion was to support |
This implementation reflects my suggested spec changes [1] which aim to preserve lifecycle operation atomicity by introducing a new RUNDOWN operation: > The `ATTACH` operation ends in CHA-RL1h4, implying that the CHA-RL1h5 > asynchronous detach happens _outside of any room lifecycle operation_. > This means that another room lifecycle operation could run at the same > time as this detach operation, which doesn't seem intentional. > > I looked at the JS implementation [2] and it seems that it keeps the > lifecycle manager’s mutex locked during this "rundown" (as it calls the > CHA-RL1h5 detach operation). But this is not implied in the spec. I > think that to translate this behaviour to the spec, which implements > mutual exclusion through lifecycle operations, we should do something > analogous to the `RETRY` operation; that is, define a new internal-only > room lifecycle operation (I’ll call it `RUNDOWN` for want of a better > term), which is scheduled by CHA-RL1h5 and which: > > - performs the detach-all-non-`FAILED`-contributors behaviour of CHA-RL1h5 > - implements the retry behaviour of CHA-RL1h6 Resolves #119. [1] ably/specification#253 [2] https://github.com/ably/ably-chat-js/blob/e8380583424a83f7151405cc0716e01302295eb6/src/core/room-lifecycle-manager.ts#L506-L509
In ably/ably-chat-swift#174 I’ve implemented this spec point in Swift in line with my suggested changes above. |
This implementation reflects my suggested spec changes [1] which aim to preserve lifecycle operation atomicity by introducing a new RUNDOWN operation: > The `ATTACH` operation ends in CHA-RL1h4, implying that the CHA-RL1h5 > asynchronous detach happens _outside of any room lifecycle operation_. > This means that another room lifecycle operation could run at the same > time as this detach operation, which doesn't seem intentional. > > I looked at the JS implementation [2] and it seems that it keeps the > lifecycle manager’s mutex locked during this "rundown" (as it calls the > CHA-RL1h5 detach operation). But this is not implied in the spec. I > think that to translate this behaviour to the spec, which implements > mutual exclusion through lifecycle operations, we should do something > analogous to the `RETRY` operation; that is, define a new internal-only > room lifecycle operation (I’ll call it `RUNDOWN` for want of a better > term), which is scheduled by CHA-RL1h5 and which: > > - performs the detach-all-non-`FAILED`-contributors behaviour of CHA-RL1h5 > - implements the retry behaviour of CHA-RL1h6 Resolves #119. [1] ably/specification#253 [2] https://github.com/ably/ably-chat-js/blob/e8380583424a83f7151405cc0716e01302295eb6/src/core/room-lifecycle-manager.ts#L506-L509
Isn't it reduces "fault tolerance" of the room? F.e. if the channel for reactions fails due to high-load, messages could still serve users and in this configurations it just fails as a whole. wdyt @lawrence-forooghian @AndyTWF @sacOO7 |
No, thats not the point. Room is treated as one unit, hence either all parts are working or all in detached/failed state. |
That's the reason, we have concept of room atomicity where we make sure every operation conforms to a certain result, only then next operation is performed. |
@maratal you might like to go through ably/ably-chat-js#405 (comment) to understand what |
We do not want |
I would understand this if all channels have equal chances of fail. But the idea of splitting came from the fact that they are not (some channels might require different server). Merging those statuses makes this splitting questionable, why not just have one room channel connected to the single server then? |
what do you mean some channels may require different server : |
When we publish messages over 2 channels
Both of those will be sent over a single connection and decoded accordingly at receiver side. It may feel like receiving on different channel, but real magic happens while encoding/decoding |
Sure thing, I forgot about it! Then ignore me 😆 |
The
ATTACH
operation ends in CHA-RL1h4, implying that the CHA-RL1h5 asynchronous detach happens outside of any room lifecycle operation. This means that another room lifecycle operation could run at the same time as this detach operation, which doesn't seem intentional.I looked at the JS implementation and it seems that it keeps the lifecycle manager’s mutex locked during this "rundown" (as it calls the CHA-RL1h5 detach operation). But this is not implied in the spec. I think that to translate this behaviour to the spec, which implements mutual exclusion through lifecycle operations, we should do something analogous to the
RETRY
operation; that is, define a new internal-only room lifecycle operation (I’ll call itRUNDOWN
for want of a better term), which is scheduled by CHA-RL1h5 and which:FAILED
-contributors behaviour of CHA-RL1h5The text was updated successfully, but these errors were encountered: