Skip to content

fix(node-sdk): increase default get timeout to 10s, add 3 retries#388

Merged
roncohen merged 5 commits intomainfrom
configurable-fetch-timeout-retry
Mar 26, 2025
Merged

fix(node-sdk): increase default get timeout to 10s, add 3 retries#388
roncohen merged 5 commits intomainfrom
configurable-fetch-timeout-retry

Conversation

@roncohen
Copy link
Contributor

Our HTTP API responds to /feature requests in less than 5ms, but there are cases where the network on the client could be dodgy or there's otherwise some delay. Especially when the program is just starting up this is problematic because the NodeSDK will use the fallback flags which for the most part are empty.

This introduces a configurable timeout and default the timeout to 10s instead of the existing 5s. It also adds an exponential retry which is set to 3 tries by default.

@roncohen roncohen requested a review from pavkam March 25, 2025 20:16
@roncohen roncohen changed the title feat: increase default get timeout to 10s, add 3 retries feat(node-sdk): increase default get timeout to 10s, add 3 retries Mar 26, 2025
@roncohen roncohen changed the title feat(node-sdk): increase default get timeout to 10s, add 3 retries fix(node-sdk): increase default get timeout to 10s, add 3 retries Mar 26, 2025
Copy link
Contributor

@pavkam pavkam left a comment

Choose a reason for hiding this comment

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

Approving but we should use some off the shelf policy management library that offers the retry timeout and back off stuff

@roncohen
Copy link
Contributor Author

Approving but we should use some off the shelf policy management library that offers the retry timeout and back off stuff

thanks! I took a quick look to try and find an appropriate library. Wanted:

  • simple
  • popular, ideally maintained by someone serious
  • uses unref on timers to avoid keeping the server running if everything else is done

I didn't find anything immediately and this fixes a current issue for customers so I'll go ahead and merge, making a mental note to be on the lookout for an appropriate library to replace our own implementation.

@roncohen roncohen enabled auto-merge March 26, 2025 09:36
@roncohen roncohen added this pull request to the merge queue Mar 26, 2025
Merged via the queue into main with commit 0e3102a Mar 26, 2025
5 checks passed
@roncohen roncohen deleted the configurable-fetch-timeout-retry branch March 26, 2025 10:03
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.

2 participants