8000 sdb: prevent closed usage & fix background sync leak by lucmq · Pull Request #21 · lucmq/go-shelve · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

sdb: prevent closed usage & fix background sync leak #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2025
Merged

Conversation

lucmq
Copy link
Owner
@lucmq lucmq commented Feb 20, 2025
  • Add a closed flag, done channel, and waitgroup to manage the background sync loop.
  • Return ErrDatabaseClosed from public methods after Close().
  • Cleanly stop the background sync goroutine to avoid leaks.
  • Update prepareForMutation to skip I/O if the DB is closed.

- Add a closed flag, done channel, and waitgroup to manage the background sync loop.
- Return ErrDatabaseClosed from public meth
8000
ods after Close().
- Cleanly stop the background sync goroutine to avoid leaks.
- Update prepareForMutation to skip I/O if the DB is closed.
@lucmq lucmq self-assigned this Feb 20, 2025
Copy link
deepsource-io bot commented Feb 20, 2025

Here's the code health analysis summary for commits 58c7049..a9cf785. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Go LogoGo✅ SuccessView Check ↗
DeepSource Test coverage LogoTest coverage✅ SuccessView Check ↗

Code Coverage Report

MetricAggregateGo
Composite Coverage96.7% (up 0.4% from main)96.7% (up 0.4% from main)
Line Coverage96.7% (up 0.4% from main)96.7% (up 0.4% from main)

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@lucmq lucmq merged commit 7e976d8 into main Feb 20, 2025
5 checks passed
@lucmq lucmq deleted the lucmq/dev branch February 20, 2025 06:00
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.

1 participant
0