Comments (4)
@tshemsedinov It looks like the HTTP server is not returning this error via the error listener. Will it be ok to catch this error in this way in worker.js, or do we need to find a more elegant solution?:
process.on('uncaughtException', function(err) {
if (err.code === 'EADDRINUSE') {
console.warn(`Address in use: ${options.host}:${port}, retry...`);
setTimeout(() => {
tryToStartCounter++;
if (tryToStartCounter > 3) process.kill(process.pid, 'SIGINT');
application.server = new metarhia.metacom.Server(application, options);
},options.timeouts.bind);
}
});
from impress.
@tshemsedinov It looks like the HTTP server is not returning this error via the error listener. Will it be ok to catch this error in this way in worker.js, or do we need to find a more elegant solution?:
process.on('uncaughtException', function(err) { if (err.code === 'EADDRINUSE') { console.warn(`Address in use: ${options.host}:${port}, retry...`); setTimeout(() => { tryToStartCounter++; if (tryToStartCounter > 3) process.kill(process.pid, 'SIGINT'); application.server = new metarhia.metacom.Server(application, options); },options.timeouts.bind); } });
I was wrong, that wasn't the point. The problem was that a wsServer was created in addition to the httpServer, and the error occurred in the wsServer, so the httpServer error listener did not catch it.
from impress.
It makes three tries to open the server on the specified port with bind timeout and then sends SIGTERM, but it doesn`t stop the application with error code 1!
from impress.
Fixed in #1908 and published 3.0.7
from impress.
Related Issues (20)
- Template pages for HTTP errors
- Template for virtual folders
- Error processing url in static directory HOT 4
- HEADERS_SENT on node 20, server static from empty folder
- Maximum call stack size exceeded
- Support units without version
- Start test after all workers started
- Support timeout and queue for hook
- Start ERR_WORKER_INVALID_EXEC_ARGV HOT 1
- hook call doesn't work
- Module loader is trying to load submodules that use optional dependencies
- Cannot set property x of #<Object> which has only a getter
- Implementing API Endpoint Throttling Tied to User Sessions
- Local API endpoint queue settings doesn't work
- Global config.timeouts.request setting doesn't applied
- Configuration server.worker.timeout doesn't limit task execution time HOT 1
- Not consistent response on exceeded global timeout of API endpoint and webhook execution HOT 1
- Impress doesn't restart worker if it crush on "JS heap out of memory"
- sends a static file by URL with multiple slashes
- Issue with application startup after updating node version to 20.12.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from impress.