Skip to content
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

beta6 upgrade #104

Merged
merged 1 commit into from
Aug 25, 2015
Merged

beta6 upgrade #104

merged 1 commit into from
Aug 25, 2015

Conversation

reqshark
Copy link
Collaborator

@nickdesaulniers, the upgrade is done.

addresses #102 and half of #103

@thelinuxlich
Copy link

great!

'ldflags': ['-ldtrace'],
'libraries': ['-ldtrace' ],
'ldflags': [ '-L<(PRODUCT_DIR) -ldtrace' ],
'libraries': [ '-ldtrace', '-L<(PRODUCT_DIR)' ],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't mean to be linking in dtrace, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, i'll take it out

@nickdesaulniers
Copy link
Owner

I get an error with one test:

git submodule sync
git submodule update
npm i
npm t
...
/Users/Nicholas/code/node/nanomsg/node_modules/tape/index.js:75
        throw err
                  ^
Error: stream.push() after EOF
    at readableAddChunk (_stream_readable.js:149:15)
    at Socket.Readable.push (_stream_readable.js:126:10)
    at Socket.<anonymous> (/Users/Nicholas/code/node/nanomsg/lib/index.js:207:24)

@reqshark
Copy link
Collaborator Author

are you sure you're pulling from the right submodule? what's the last commit hash on that submodule?

@nickdesaulniers
Copy link
Owner

* 5515f96 - (HEAD, tag: 0.6-beta) Bump ABI version for 0.6-beta. (4 weeks ago) <Garrett D'Amore>

@reqshark
Copy link
Collaborator Author

you're using node 0.12 aren't you

@reqshark
Copy link
Collaborator Author

using node 0.12 i'm able to reproduce your result, apparently returning after the survey test passes (and just before it completes).

✔  bent@osx /Users/bent.cardan/reqshark/node-nanomsg  [beta6|✔ ] 
12:53 $ node test/survey
TAP version 13
# inproc socket survey
ok 1 (unnamed assert)
ok 2 (unnamed assert)
ok 3 (unnamed assert)
ok 4 (unnamed assert)
/Users/bent.cardan/reqshark/node-nanomsg/node_modules/tape/index.js:75
        throw err
              ^
Error: stream.push() after EOF
    at readableAddChunk (_stream_readable.js:149:15)
    at Socket.Readable.push (_stream_readable.js:126:10)
    at Socket.<anonymous> (/Users/bent.cardan/reqshark/node-nanomsg/lib/index.js:207:24)

we need to rewrite node.js survey sockets in light of updates to respondent/survey behavior in libnanomsg. note that what we're testing here calls

socket.survey(msg)

on a surveyor socket, which is different than calling

socket.send(msg)

this is an inconsistent area of our API that has little or nothing to do with the upgrade.

one problem i see here is that we're removing a listener that doesn't exist. I think this type specific API stuff was done back when libnanomsg only partially implemented the surveyor/respondent pattern.

since then the pattern's been improved by the clib, certainly in beta6 and possibly earlier in beta5. let's open a separate issue to track this and not let it prevent the upgrade

@reqshark
Copy link
Collaborator Author

hmm, wait why does the survey pass on node 0.12 before the upgrade...

15:35 $ node test/survey.js 
TAP version 13
# inproc socket survey
ok 1 (unnamed assert)
ok 2 (unnamed assert)
ok 3 (unnamed assert)
ok 4 (unnamed assert)

1..4
# tests 4
# pass  4

# ok

that means it has something to do with the upgrade and we'll need to revise our survey socket code

• stop linking dtrace
• crank up optimizations to O3
• fix survey stream
@@ -184,7 +184,7 @@ Socket.prototype._receive = function () {
this._stopPollSend();
this._stopPollReceive();
this.emit('survey-timeout');
return;
return null;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

returning null here inside the survey's recv operation ends of the stream properly instead of getting EOF

@reqshark
Copy link
Collaborator Author

@nickdesaulniers i went through our survey code and made a small change to how survey's recv returns.

now I think the problem had more to do with streams than survey actually, though it's still interesting to me that we only saw this behavior with the upgrade.

anyway, by pushing a value of undefined onto a stream we get unexpected behavior.

by pushing null we end the stream, which is what i think we intend to do here: https://github.com/nickdesaulniers/node-nanomsg/blob/beta6/lib/index.js#L187

@reqshark
Copy link
Collaborator Author

dude when you get back from the BrazilJS conf Porto Alegre, this PR needs some ❤️ ... after this is merged we need to fix iojs3.. nan 2... i was holding off on nan2 since this changes the clib slightly.

btw hope ur having a good time down there.. 🌴 this comment doesnt have anything to do with the PR but i was checking out your your conference slides and was wondering if you could pls explain:

Prefer task level parallelism (postMessage) to data level parallelism (SharedArrayBuffer)

@nickdesaulniers
Copy link
Owner

k let's do 🍻 brother!

@nickdesaulniers nickdesaulniers merged commit a65df1b into master Aug 25, 2015
@nickdesaulniers nickdesaulniers deleted the beta6 branch August 25, 2015 16:36
@nickdesaulniers
Copy link
Owner

@reqshark , can you publish to npm? 🍤

@reqshark
Copy link
Collaborator Author

done. now npm install has beta6 for everything < iojs-v2.5.0.

We'll need to get nan2 updates done for v3+.

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

Successfully merging this pull request may close these issues.

3 participants