Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

added _id correlation avoiding roles criss cross on race condition #11

merged 1 commit into from Jul 19, 2012


None yet
2 participants

mbrevoort commented Jul 17, 2012

This is a fix for issue #10

The role lookup was only considering host and port so if an assume happened on reconnection before the connection end, the free from the original connection would free the reconnection's assume. I added an ID to the role object so that it would only free roles corresponding to the original allocation on that connection.

Incidentally, I can't get the tests to pass on my machine since commit 3226531 though I see that it's testing fine on Travis. I can't spin my wheels anymore on this tonight but this change definitely fixes my issue. The tests fail on resubscribe.js and resubscribe_delay.js with this output.

./node_modules/.bin/tap --tap test/resubscribe.js
# TAP version 13
# resubscribe if connection dies
ok 1 allocate emitted
ok 2 assume emitted
ok 3 free emitted
ok 4 allocate emitted
ok 5 assume emitted
ok 6 free emitted
ok 7 allocate emitted
ok 8 assume emitted
ok 9 free emitted
not ok 10 test count != plan
    file:   node.js
    line:   192
    column: 40
      - getCaller (/Users/mikebre/development/personal/seaport/node_modules/tap/lib/tap-assert.js:415:17)
      - assert (/Users/mikebre/development/personal/seaport/node_modules/tap/lib/tap-assert.js:20:16)
      - Function.equal (/Users/mikebre/development/personal/seaport/node_modules/tap/lib/tap-assert.js:161:10)
      - Test.end (/Users/mikebre/development/personal/seaport/node_modules/tap/lib/tap-harness.js:116:31)
      - Test._endNice (/Users/mikebre/development/personal/seaport/node_modules/tap/lib/tap-test.js:69:26)
      - Array.0 (native)
      - EventEmitter._tickCallback (node.js:192:40)
    found:  9
    wanted: 6
ok 11 closed server
# tests 11
# pass  10
# fail  1
not ok 12 test/resubscribe.js
    timedOut: true
    exit:     1
    command:  "node" "resubscribe.js"

# tests 12
# pass  10
# fail  2

mbrevoort commented Jul 19, 2012

Just following up; I've been running with this for several days and it definitely did fix the issue.

@substack substack merged commit 243305a into substack:master Jul 19, 2012


substack commented Jul 19, 2012

Thanks for the fixes! Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment