-
Notifications
You must be signed in to change notification settings - Fork 41
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
Changing context causes clients to disconnect #393
Comments
I'm able to stand up a NeoHabitat service using Amanda's fork as long as I manually run npm install inside the pushserver directory of the container and this issue doesn't occur for me for some reason. Amanda has the same problem as you though @ottj . What OS are you using? Does it happen for you if you use an existing user in the database? (Try logging in as Chip, Randy or Stu). We had suspicions that there was API drift in our version of MongoDB regarding writing to the database, but because I was able to make things work with no changes besides what I mentioned above, I'm not sure. Unless somehow our versions of Mongo are different, then I'm not sure what's up. |
OS: I have it running in docker on macOS (intel) and in docker on a Synology NAS.
I will check which mongo versions are running in the containers. |
This is the output (with Mongo version 4.0.22) of the mongoDB container at startup:
` |
Further context from Randy on slack messages:
This appears to be from: neohabitat/bridge/Habitat2ElkoBridge.js Lines 471 to 489 in 37bb296
|
From the Keith on the MADE Slack
https://nodejs.org/docs/latest-v18.x/api/process.html#processnexttickcallback-args This is in reference to the code at: neohabitat/bridge/Habitat2ElkoBridge.js Lines 471 to 489 in 37bb296
|
This adds a process.nextTick handler to the server.on end event in Habitat2Elkobridge This was a suggested fix from Keith at The MADE frandallfarmer#393 (comment) This should address frandallfarmer#393 frandallfarmer#431 and others
further context on a test case from: #433 (comment)
|
(I use the newest version with the changes of the fork from amandaJonesAway)
If I connect with an existing or new user they spawn in the immigration context. Upon exit the client gets disconnected:
`neohabitat-neohabitat-1 | - 2023/04/03 18:43:57.417 EVN cont (User.connectionDied:User.java:159) User 'user-testuser-7751387903278591649' connection died: TCP(2)
neohabitat-neohabitat-1 | debug: Elko port disconnected...
neohabitat-neohabitat-1 | debug: {Bridge being shutdown...}
neohabitat-neohabitat-1 | - 2023/04/03 18:43:57.441 EVN comm-cli : TCP(3) new connection from 172.18.0.4:32896
neohabitat-neohabitat-1 | debug: Server connection established on: 172.18.0.4:60228 (unknown)
neohabitat-neohabitat-1 | debug: Connecting: 172.18.0.4:1337 <-> 172.18.0.4:60228
neohabitat-neohabitat-1 | debug: Habitat client disconnected.
neohabitat-neohabitat-1 | debug: Client disconnected for Client 172.18.0.4:60228 (unknown), moving session to ASLEEP
neohabitat-neohabitat-1 | debug: Disconnecting Habiproxy connection on: 172.18.0.4:60228 (unknown)
neohabitat-neohabitat-1 | - 2023/04/03 18:43:57.456 EVN comm-cli : TCP(3) remote disconnect
neohabitat-neohabitat-1 | - 2023/04/03 18:43:57.459 EVN comm-cli : TCP(3) died: java.io.EOFException
neohabitat-neohabitat-1 | debug: Elko port disconnected...
neohabitat-neohabitat-1 | debug: {Bridge being shutdown...}
neohabitat-neohabitat-1 | warn: Error [ERR_STREAM_WRITE_AFTER_END]: write after end
neohabitat-neohabitat-1 | warn: Error [ERR_STREAM_WRITE_AFTER_END]: write after end
`
If I comment these 4 lines starting at 478 in Habitat2ElkoBridge and prevent any disconnect I can change contexts just fine:
` server.on('end', function() {
`
This is more of a hack than a proper fix, hence I did not create a PR. I was not able to trace the source problem yet.
The text was updated successfully, but these errors were encountered: