Closed princjef closed 6 years ago
Review status: 0 of 1 files reviewed at latest revision, 1 unresolved discussion.
lib/session.js, line 181 at r1 (raw file):
var state = this.sm.getMachineState(); debug('trying to begin() a session in state ' + state); switch (state) {
wouldn't that switch mean that we need to make "begin" an action of the state machine?
Comments from Reviewable
lib/session.js, line 181 at r1 (raw file):
wouldn't that switch mean that we need to make "begin" an action of the state machine?
good call. moved begin()
into the state machine in place of beginSent()
with the appropriate guards/checks
Comments from Reviewable
Reviewed 1 of 1 files at r1, 2 of 2 files at r2. Review status: all files reviewed at latest revision, all discussions resolved.
Comments from Reviewable
With
reestablish
enabled for sessions, the session can end up in a state where it is trying to reestablish itself while the connection is trying to do the same, leading to duplicate calls tobegin()
. The following has been changed to better handle this situation and others like it:begin()
attempt (and any further retries) if the link isn't stillUNMAPPED
. We already handle if the connection is broken, but this handles the connection coming down and back up (with a correspondingbegin()
call) while we're waiting to retry.begin()
isn't idempotent, calling it on a session that is already active with attached links will cause a second session to be established and the links to be implicitly assigned to that session without the server being informed. We now do nothing if the session is already active and throw if it's in a transition state.begin()
. Thedisconnected()
transition has been added to the state machine to take care of this. For reference, the AMQP 1.0 spec states that "Sessions end automatically when the Connection is closed or interrupted.", so this behavior is consistent with the specification.This change is