Skip to content
This repository was archived by the owner on Nov 4, 2021. It is now read-only.

Retry plugin initialization before punishing - #460

Merged
Twixes merged 12 commits into
masterfrom
retries-on-punish
Jun 9, 2021
Merged

Twixes merged 12 commits into
masterfrom
retries-on-punish

Conversation

@yakkomajuri

@yakkomajuri yakkomajuri commented Jun 3, 2021 •

Copy link
Copy Markdown
Contributor

Changes

Retrying plugin VM initialization with exponential backoff before ultimately disabling the plugin.

Resolves #387

The approach here is simply to reset the resolveInternalVm promise with timeouts using an exponential backoff mechanism such that the plugin will continue to be enabled, but the user will see an error, and its methods will return null (i.e. none of its methods will run or affect anything) for the whole time while we retry until that promise gets resolved to a vm or we cap out at 15 retries.

I followed the suggestion in #387 but I'm thinking ~24h (15 retries) is a bit much - thoughts?

Checklist

  • Updated Settings section in README.md, if settings are affected
  • Jest tests

@yakkomajuri
yakkomajuri requested a review from Twixes June 3, 2021 17:56
@yakkomajuri yakkomajuri changed the title WIP Retry plugin initialization before punishing Retry plugin initialization before punishing Jun 3, 2021
Comment thread src/worker/vm/lazy.ts Outdated
Comment thread src/worker/vm/lazy.ts Outdated
Comment thread src/worker/vm/lazy.ts Outdated
Comment thread src/worker/vm/lazy.ts Outdated
@Twixes Twixes added the bump minor Bump minor version when this PR gets merged label Jun 8, 2021
@yakkomajuri

Copy link
Copy Markdown
Contributor Author

Should I merge? @Twixes

@Twixes Twixes 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.

👍

@Twixes Twixes added bump patch Bump patch version when this PR gets merged and removed bump minor Bump minor version when this PR gets merged labels Jun 9, 2021
@Twixes
Twixes merged commit 78ea1a8 into master Jun 9, 2021
@Twixes
Twixes deleted the retries-on-punish branch June 9, 2021 10:52
fuziontech pushed a commit to PostHog/posthog that referenced this pull request Oct 12, 2021
…/plugin-server#460)

* WIP Retry plugins when punishing

* update retry ms time

* add tests

* fix tests

* minor style fixes

* minor tweaks

* address review points

* fix tests

* Slightly clarify `initVm`

Co-authored-by: Michael Matloka <dev@twixes.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bump patch Bump patch version when this PR gets merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retries when punishing plugins

2 participants