Skip to content

Add a way for configurable socket timeouts#1430

Open
flippmoke wants to merge 4 commits into
redis:masterfrom
flippmoke:socket_timeout
Open

Add a way for configurable socket timeouts#1430
flippmoke wants to merge 4 commits into
redis:masterfrom
flippmoke:socket_timeout

Conversation

@flippmoke

@flippmoke flippmoke commented Apr 23, 2019

Copy link
Copy Markdown

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

Added a way for connected sockets to timeout. This is important for situations where a connected server stops responding and the connection should close in a reasonable time.

@BridgeAR BridgeAR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code itself is LGTM. I have to give this another thought if it's best to better document to access the stream property directly as user to do these things or to add "native" option instead.

I would be happy about feedback from others about this!

@flippmoke

Copy link
Copy Markdown
Author

@BridgeAR I would support putting this in because you would need to access the the stream property directly on a connect event and this seems like a lot of extra work. Additionally, the other timeout option is confusing because its easy to assume that this timeout does exactly what this timeout option specifies.

@DanielSeehausen

Copy link
Copy Markdown

@BridgeAR I would support putting this in because you would need to access the the stream property directly on a connect event and this seems like a lot of extra work. Additionally, the other timeout option is confusing because its easy to assume that this timeout does exactly what this timeout option specifies.

👍 for @flippmoke comment @BridgeAR

@Salakar Salakar added this to the v3.0.0 milestone Feb 7, 2020
@flippmoke

Copy link
Copy Markdown
Author

Bump on this?

@leibale

leibale commented Apr 27, 2021

Copy link
Copy Markdown
Contributor

@flippmoke LGTM. Please resolve the conflicts with master, and I'll merge it.

@flippmoke

Copy link
Copy Markdown
Author

@leibale updated the branch, there are some failures but do not seem to be related to my changes.

@leibale

leibale commented Apr 28, 2021

Copy link
Copy Markdown
Contributor

@flippmoke please fix those eslint errors:
line 377 in test/connection.spec.js - Trailing spaces not allowed
line 363 in index.js - Missing space before function parentheses

@flippmoke

Copy link
Copy Markdown
Author

@leibale sorry I missed those pushed now

@leibale leibale removed this from the v3.0.0 milestone Jun 29, 2021
@orzelek12

Copy link
Copy Markdown

Hi @leibale @flippmoke @BridgeAR
can you merge that PR and release a new version?
as u can see in Issues section there are a lot of ppl that find the lack of this feature disturbing.
In case of Redis server being unresponsive, the current implementation node-redis will cause the app to break since it will try to connect over an over again.
Please merge this changes in order to allow us stop the connection after given time.

@philon-msft

Copy link
Copy Markdown

@dmaier-redislabs Any chance we can get this (or something similar) merged soon?

@dmaier-redislabs

Copy link
Copy Markdown
Contributor

@bobymicroby @elena-kolevska Can you please take a look and see if this can be merged before the next release?

@bobymicroby

Copy link
Copy Markdown
Member

@philon-msft The code base has evolved significantly during the last few years, so this PR will not be easily mergeable. We recognize the need for such functionality (we have added this feature to ioredis recently), but we also recognize that such features need to be implemented carefully (see here a subsequent fix for connection instability caused by the socket timeout feature).

We are going to add this feature to the client with a new PR.

@philon-msft

Copy link
Copy Markdown

Thanks @bobymicroby, will the new PR make it into the next release?

@bobymicroby

Copy link
Copy Markdown
Member

@philon-msft probably, but cannot make commitments ; will ping you if there is movement on that

@nkaradzhov

Copy link
Copy Markdown
Collaborator

Hi, this is the new PR for this change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants