Skip to content

Commit 649eaf2

Browse files
committed
update EADDRINUSE warning (currently a red-herring) to explain what likely happened; closes #5
1 parent 7dda57b commit 649eaf2

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ exports.handler = (event, context) => awsServerlessExpress.proxy(server, event,
2020

2121
## Quick Start/Example
2222

23-
Want to get up and running quickly? [Check out our example](example/README.md) which includes:
23+
Want to get up and running quickly? [Check out our example](example) which includes:
2424

2525
- Lambda function
2626
- Express server

example/scripts/local.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ function exitHandler(options, err) {
2424

2525
process.on('exit', exitHandler.bind(null, { cleanup: true }))
2626
process.on('SIGINT', exitHandler.bind(null, { exit: true })) // ctrl+c event
27+
process.on('SIGTSTP', exitHandler.bind(null, { exit: true })) // ctrl+v event
2728
process.on('uncaughtException', exitHandler.bind(null, { exit: true }))

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function createServer (requestListener, serverListenCallback, binaryTypes) {
155155
})
156156
.on('error', (error) => {
157157
if (error.code === 'EADDRINUSE') {
158-
console.warn(`EADDRINUSE ${getSocketPath(server._socketPathSuffix)} incrementing socketPathSuffix.`)
158+
console.warn(`WARNING: Attempting to listen on socket ${getSocketPath(server._socketPathSuffix)}, but it is already in use. This is likely as a result of a previous invocation error or timeout. Check the logs for the invocation(s) immediately prior to this for root cause, and consider increasing the timeout and/or cpu/memory allocation if this is purely as a result of a timeout. aws-serverless-express will restart the Node.js server listening on a new port and continue with this request.`)
159159
++server._socketPathSuffix
160160
return server.close(() => startServer(server))
161161
}

0 commit comments

Comments
 (0)