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

Cannot read property 'Symbol(type)' of undefined #24546

Closed
davedoesdev opened this issue Nov 21, 2018 · 2 comments
Closed

Cannot read property 'Symbol(type)' of undefined #24546

davedoesdev opened this issue Nov 21, 2018 · 2 comments

Comments

@davedoesdev
Copy link
Contributor

Sample program:

const { createServer, connect } = require('http2');
createServer().listen(7000, () => {
    connect('http://localhost:7000', session => {
        session.request({ ':method': 'POST' }).end(() => {
            session.destroy();
        });
    });
});

Exception:

internal/http2/core.js:2009
          this[kSession][kType] === NGHTTP2_SESSION_SERVER &&
                        ^

TypeError: Cannot read property 'Symbol(type)' of undefined
    at ClientHttp2Stream.[kMaybeDestroy] (internal/http2/core.js:2009:25)
    at ShutdownWrap.afterShutdown [as oncomplete] (internal/http2/core.js:1547:26)
    at ClientHttp2Stream._final (internal/http2/core.js:1841:14)
    at callFinal (_stream_writable.js:617:10)
    at process.internalTickCallback (internal/process/next_tick.js:72:19)

Cause is destroy() happening (and setting [kSession] to undefined) before afterShutdown then calls [kMaybeDestroy]().

The example shows a simple repro but if timing is wrong then it can also 'just happen' (session is destroyed while stream is shutting down.

leeight added a commit to leeight/node that referenced this issue Nov 22, 2018
`finishSessionDestroy` already done session cleaning up.

Fix: nodejs#24546
Trott pushed a commit to Trott/io.js that referenced this issue Nov 25, 2018
`finishSessionDestroy` session cleanup when already done.

PR-URL: nodejs#24547
Fixes: nodejs#24546
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ouyang Yadong <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@Trott
Copy link
Member

Trott commented Nov 25, 2018

Fixed in 895fe2f

@Trott Trott closed this as completed Nov 25, 2018
targos pushed a commit that referenced this issue Nov 25, 2018
`finishSessionDestroy` session cleanup when already done.

PR-URL: #24547
Fixes: #24546
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ouyang Yadong <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@davedoesdev
Copy link
Contributor Author

Thanks!

rvagg pushed a commit that referenced this issue Nov 28, 2018
`finishSessionDestroy` session cleanup when already done.

PR-URL: #24547
Fixes: #24546
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ouyang Yadong <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
refack pushed a commit to refack/node that referenced this issue Jan 14, 2019
`finishSessionDestroy` session cleanup when already done.

PR-URL: nodejs#24547
Fixes: nodejs#24546
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ouyang Yadong <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
BethGriggs pushed a commit that referenced this issue Feb 11, 2019
`finishSessionDestroy` session cleanup when already done.

PR-URL: #24547
Fixes: #24546
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ouyang Yadong <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
rvagg pushed a commit that referenced this issue Feb 28, 2019
`finishSessionDestroy` session cleanup when already done.

PR-URL: #24547
Fixes: #24546
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ouyang Yadong <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants