fix(arweave_config_legacy): timeout during high load#961
Conversation
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on March 13. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
There was a problem hiding this comment.
Pull request overview
This PR refactors the arweave_config_legacy module to fix timeout issues during high load by replacing synchronous gen_server:call messaging with direct ETS table reads for configuration access. The gen_server is still used for write operations, maintaining consistency while improving read performance.
Changes:
- Replaced gen_server state record with ETS table for storing configuration
- Modified read functions (
get/0,get/1,has_key/1,get_env/0) to read directly from ETS instead of calling gen_server - Updated all
handle_callcallbacks to use ETS instead of state record - Added tests for unsupported message handlers
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| apps/arweave_config/src/arweave_config_legacy.erl | Core refactoring from gen_server state to ETS-based storage; updated read/write operations |
| apps/arweave_config/test/arweave_config_legacy_SUITE.erl | Added tests for unsupported handler messages |
Comments suppressed due to low confidence (1)
apps/arweave_config/src/arweave_config_legacy.erl:312
- The error list contains a duplicate entry for 'from'. Line 310 and line 312 both have {from, From}. This creates redundant information in the error log. Either remove one occurrence or replace the second one with a different field.
{from, From},
{message, Message},
{from, From},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
afb25bc to
7287715
Compare
This commit fixes a timeout on arweave_config_legacy when to many processes are trying to communicate with it. Instead of using messaging, a protected ETS table has been created, where the processes can directly fetch the configuration from it.
This commit fixes a timeout on arweave_config_legacy when to many processes are trying to communicate with it. Instead of using messaging, a protected ETS table has been created, where the processes can directly fetch the configuration from it.