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

the Expressjs server silently crashes #95

Open
felixhao28 opened this issue Nov 27, 2018 · 0 comments
Open

the Expressjs server silently crashes #95

felixhao28 opened this issue Nov 27, 2018 · 0 comments

Comments

@felixhao28
Copy link

I am using node v10.12.0 on Windows 10 x64. After the expressjs server runs for a while, having handled a few thousands requests (the number varied for each run, the requests for each run are exactly the same, including both order and contents), the server simply crashed without error message. I have added these error handlers but none logged anything for me:

    process.on('uncaughtException', function (exception) {
        console.log(exception);
    });
    process.on('unhandledRejection', function (exception) {
        console.log(exception);
    });
    process.on('exit', function (exception) {
        console.log('exit'); // even this line never gets printed
        console.log(exception);
    });
    app.use((err: any, req: Request, res: Response, next: NextFunction) => {
        console.error(err.stack)
        res.status(500).send('Something broke!') // client never received 500 code
    });

The only thing I got the error code "-1073741819", using echo %ERRORLEVEL% on command line.

The way I use node-weak is to store a weak reference in a Queue from typescript-collections and check if it has desired member "timestamp":

    addToEntry(node: TrieNode<T>) {
        this.expireQueue.add([new Date().getTime(), weak(node)]);
        this.nodeCount++;
        while (this.nodesLimit < this.nodeCount) {
            const [timestamp, deleteNode] = this.expireQueue.dequeue() as [number, TrieNode<T>];
            if (deleteNode.timestamp && timestamp >= deleteNode.timestamp) {
                this.deleteNode(deleteNode);
            }
        }
    }

After I switch weak(node) to node, crashing stopped happening. I am sorry for being unable to offer you full code to reproduce the bug (because it is proprietary) or more information (because I don't know more).

@felixhao28 felixhao28 changed the title Expressjs the server silently crashes the Expressjs server silently crashes Nov 27, 2018
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

No branches or pull requests

1 participant