fix[message-relayer]: avoid getting OOM killed#949
Conversation
🦋 Changeset detectedLatest commit: 01d8a17 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 Report
@@ 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.
|
|
|
||
| // tslint:disable-next-line | ||
| const event = this.state.eventCache.find((event) => { | ||
| return ( |
There was a problem hiding this comment.
This line is pretty verbose. Also should we consider using a Map for the cache?
There was a problem hiding this comment.
We could. For now I just refactored this logic a bit to make it a little more clear.
tynes
left a comment
There was a problem hiding this comment.
Looks good to me, we should get this deployed to kovan asap
* 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
Description
Updates the
message-relayerto 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.