Skip to content
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

Pavel/epd 1022 oom #22

Merged
merged 3 commits into from
Jan 30, 2023
Merged

Pavel/epd 1022 oom #22

merged 3 commits into from
Jan 30, 2023

Conversation

pavelflux
Copy link
Collaborator

@pavelflux pavelflux commented Jan 30, 2023


labels: mergeable

Fixes: EPD-1022

Motivation and Context

There is quite a complex issue with OOM, best seen in e2e tests of the main repo.
For this to be fixed, we need to be able to stop polling manually via the EppoSDKClient.

Description

After adding eppo sdk client to api e2e tests in main repo (in this PR)
we started to hit OOM error (while running jest, locally or in GH Actions).
After some research I found out that eppo sdk is causing this issue.
My logic here is:

  ●  Cannot log after tests are done. Did you forget to wait for something async in your test?
    Attempted to log "Error polling configurations: connect ECONNREFUSED ::1:4000".

      at console.error (node_modules/@jest/console/build/BufferedConsole.js:127:10)
      at Timeout.poll [as _onTimeout] (node_modules/@eppo/node-server-sdk/src/poller.ts:27:15)


  ●  Cannot log after tests are done. Did you forget to wait for something async in your test?
    Attempted to log "Error polling configurations: connect ECONNREFUSED ::1:4000".

      at console.error (node_modules/@jest/console/build/BufferedConsole.js:127:10)
      at Timeout.poll [as _onTimeout] (node_modules/@eppo/node-server-sdk/src/poller.ts:27:15)


  ●  Cannot log after tests are done. Did you forget to wait for something async in your test?
    Attempted to log "Error polling configurations: connect ECONNREFUSED ::1:4000".

      at console.error (node_modules/@jest/console/build/BufferedConsole.js:127:10)
      at Timeout.poll [as _onTimeout] (node_modules/@eppo/node-server-sdk/src/poller.ts:27:15)

even if this does not lead to OOM issue itself, it prevents Jest from exiting. (Jest has an issue with OOM, which I fixed in the PR (ADD LINK TO PR HERE)

Also, please note that recursive setTimeout itself is OOM-prone, so if it was not for the jitter, I would replace it with setInterval.

@leoromanovsky @chasdevs maybe we can have another condition to stop the recursion?

How has this been tested?

Manually and via tests

@pavelflux pavelflux self-assigned this Jan 30, 2023
Copy link

@chasdevs chasdevs left a comment

Choose a reason for hiding this comment

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

I'd reshuffle the args but I'm OK with the change. Seems more ideal to not instantiate the eppo client altogether in our backend integration tests.

@@ -35,6 +36,7 @@ export interface IEppoClient {
export default class EppoClient implements IEppoClient {
constructor(
private configurationRequestor: ExperimentConfigurationRequestor,
private poller: IPoller,

Choose a reason for hiding this comment

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

Probably better to add the param at the end, so anyone implementing this constructor doesn't have to reshuffle arg order.

@leoromanovsky leoromanovsky requested a review from a team January 30, 2023 14:35
Copy link
Member

@leoromanovsky leoromanovsky left a comment

Choose a reason for hiding this comment

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

ok let's try this way and see

@pavelflux pavelflux merged commit 7e39dba into main Jan 30, 2023
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.

3 participants