Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Which adapter to chose - sticky session#5178

Unanswered
JojoRebondy asked this question inQ&A
Discussion options

Hi everyone.

I'm trying to chose which adapter is best suited in my use-case which is the following:

We have several servers, each server have several worker that have a socket.io server listening to incoming connections.

Here are our needs:

  • long polling
  • connection state recovery
  • an emitter

Since we need to be long polling compatible, we need to be able to redirect an incoming connection onto the good server & worker if that's not the first request.
For that problem we thought about using a redis adapter coupled with a sticky session mechanism (either with a proxy or with the library socket.io-sticky)

The problem is: the redis adapter is NOT compatible with connection state recovery.

We then thought about using the redis stream adapter, which is connection state recovery compatible.

When trying to implement the redis stream adapter coupled with @socket.io/sticky we kept having the following error:
`

Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace athttps://github.com/nodejs/node/issues

at new NodeError (node:internal/errors:405:5)at assert (node:internal/assert:14:11)at ServerResponse.detachSocket (node:_http_server:294:3)at resOnFinish (node:_http_server:984:7)at ServerResponse.emit (node:events:514:28)at onFinish (node:_http_outgoing:1005:10)at afterWrite (node:internal/streams/writable:507:5)at afterWriteTick (node:internal/streams/writable:494:10)at process.processTicksAndRejections (node:internal/process/task_queues:81:21) {

code: 'ERR_INTERNAL_ASSERTION'
}
`
We did not find yet a solution for that crash. Furthermore we learned that Redis Stream Adapter does not provide an Emitter so that's no good for us.

Here is an image (found in the socket.io-sticky README.md) that seems to describe exactly our use case, yet it does not work for us.

image

There are high chance that we are doing something wrong, but also a good chance that we are not using the right tool for our use-case.

If anyone has any knowledge on this subject, a little help would be greatly appreciated.

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

Any idea as to when the postgres adapter will be working for the connection state recovery ?

You must be logged in to vote
1 reply
@darrachequesne
Comment options

@JojoRebondy I'm looking into this.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@JojoRebondy@darrachequesne

[8]ページ先頭

©2009-2025 Movatter.jp