[PR #3781] fix: improve storage reliability with better error handling and lock cleanup #10756

Closed
opened 2026-02-16 18:15:30 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/3781

State: closed
Merged: No


Summary

Improve storage system reliability with better error handling and lock cleanup.

Changes

JSON Error Handling

  • Corrupted JSON files in migration are now skipped with warnings instead of failing
  • Prevents migration from crashing on individual corrupted files

Lock Cleanup

  • Automatic cleanup for unused locks after 10 seconds of inactivity
  • Prevents memory leaks in long-running processes
  • Periodic cleanup every 5 seconds

Global Lock Maintained

  • Storage operations require global synchronization due to interdependencies
  • Ensures data consistency across session/message/part files

Notes

During testing, concurrent session creation showed JSON parsing errors in session.prompt that may indicate issues with repeated session reads during doom loop detection. Further investigation recommended.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/3781 **State:** closed **Merged:** No --- ## Summary Improve storage system reliability with better error handling and lock cleanup. ## Changes **JSON Error Handling** - Corrupted JSON files in migration are now skipped with warnings instead of failing - Prevents migration from crashing on individual corrupted files **Lock Cleanup** - Automatic cleanup for unused locks after 10 seconds of inactivity - Prevents memory leaks in long-running processes - Periodic cleanup every 5 seconds **Global Lock Maintained** - Storage operations require global synchronization due to interdependencies - Ensures data consistency across session/message/part files ## Notes During testing, concurrent session creation showed JSON parsing errors in session.prompt that may indicate issues with repeated session reads during doom loop detection. Further investigation recommended.
yindo added the pull-request label 2026-02-16 18:15:30 -05:00
yindo closed this issue 2026-02-16 18:15:30 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10756