Skip to content

fix[message-relayer]: avoid getting OOM killed#949

Merged
tynes merged 7 commits intodevelopfrom
kelvin/fix-relayer-oom
May 24, 2021
Merged

fix[message-relayer]: avoid getting OOM killed#949
tynes merged 7 commits intodevelopfrom
kelvin/fix-relayer-oom

Conversation

@smartcontracts
Copy link
Copy Markdown
Contributor

Description
Updates the message-relayer to automatically remove any events from the cache that are no longer necessary. We ended up holding these cached events forever and would eventually get OOM killed.

@smartcontracts smartcontracts requested a review from K-Ho as a code owner May 24, 2021 20:32
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented May 24, 2021

🦋 Changeset detected

Latest commit: 01d8a17

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@eth-optimism/message-relayer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #949 (147160c) into develop (c880043) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #949   +/-   ##
========================================
  Coverage    82.21%   82.21%           
========================================
  Files           48       48           
  Lines         1895     1895           
  Branches       303      303           
========================================
  Hits          1558     1558           
  Misses         337      337           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c880043...147160c. Read the comment docs.


// tslint:disable-next-line
const event = this.state.eventCache.find((event) => {
return (
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.

This line is pretty verbose. Also should we consider using a Map for the cache?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could. For now I just refactored this logic a bit to make it a little more clear.

Copy link
Copy Markdown
Contributor

@tynes tynes left a comment

Choose a reason for hiding this comment

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

Looks good to me, we should get this deployed to kovan asap

@tynes tynes removed the 2-reviewers label May 24, 2021
@tynes tynes merged commit e3b138b into develop May 24, 2021
@tynes tynes deleted the kelvin/fix-relayer-oom branch May 24, 2021 22:55
InoMurko pushed a commit to omgnetwork/optimism that referenced this pull request May 25, 2021
* fix[message-relayer]: avoid getting OOM killed

* chore: add changeset

* fix some errors in cache eviction logic

* make things a little more clear

* slight refactor and add another function comment

* more minor refactors for legibility

* fix a bignumber bug
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.

4 participants