reset listening state for each secondary server#4802
reset listening state for each secondary server#4802cjihrig wants to merge 3 commits intofastify:ci/node-20from cjihrig:fix
Conversation
The listenCallback() function is called for each secondary address that a server should listen on. However, each call sets the listening state to true, so subsequent addresses fail with FST_ERR_REOPENED_SERVER. This commit resets the state on each call.
|
ping @mcollina |
climba03003
left a comment
There was a problem hiding this comment.
Should L107 be removed? and move the comment to new place?
|
The Maybe we can isolate the Line 169 in f6a0ff3 |
Yes, that's what I was saying in the OP. If you want to take this over and implement your suggestion, I'm fine with that. |
|
I've moved this to #4810 since the node-20 branch was merged.
I'm not sure about that because it's possible that the |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The
listenCallback()function is called for each secondary address that a server should listen on. However, each call sets the listening state totrue, so subsequent addresses fail withFST_ERR_REOPENED_SERVER. This commit resets the state on each call.Note:
I had a bit of trouble creating a test for this. The existing tests all have
plan()calls expecting the number of listening addresses to match the number of addresses on the system. This is an incorrect assumption. The listening logic inmultipleBindings()inlib/server.jsignores errors encountered when trying to listen. For example, on my machine, I have 3 interfaces, but Fastify can only listen on two of them.Checklist
npm run testandnpm run benchmarkand the Code of conduct