Skip to content
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

Enhance Concurrency and Lock Management in Staged Stream Sync Module #4772

Merged
merged 12 commits into from
Oct 28, 2024

Conversation

GheisMohammadi
Copy link
Contributor

@GheisMohammadi GheisMohammadi commented Oct 14, 2024

This PR introduces improvements to the concurrency handling and lock management in the Staged Stream Sync module. By replacing sync.Mutex with sync.RWMutex, the module now supports concurrent read access, which enhances performance for read-heavy operations. The scope of locks has also been minimized, reducing contention, particularly in high-frequency functions like Get() and List()

To improve the shutdown process, additional checks have been added to prevent double closure of channels, and new locking mechanisms have been implemented to ensure the synchronization of state changes during shutdown. This makes the shutdown process smoother and prevents potential race conditions when terminating active processes.

Furthermore, clearer documentation and error messages have been added to enhance consistency and reduce potential confusion.

These changes collectively improve the performance, reliability, and maintainability of the Staged Stream Sync module by ensuring better resource management, reducing the likelihood of race conditions, and allowing concurrent operations to proceed more efficiently.

@GheisMohammadi GheisMohammadi self-assigned this Oct 14, 2024
@GheisMohammadi GheisMohammadi marked this pull request as draft October 14, 2024 12:12
@GheisMohammadi GheisMohammadi changed the title Improve Staged Stream Sync Lock Handling Enhance Concurrency and Lock Management in Staged Stream Sync Module Oct 15, 2024
@GheisMohammadi GheisMohammadi changed the base branch from fix/staged_stream_sync_getblock_failure to dev October 24, 2024 06:11
@GheisMohammadi GheisMohammadi marked this pull request as ready for review October 24, 2024 06:12
@GheisMohammadi GheisMohammadi force-pushed the refactor/staged_stream_sync branch from b455976 to 6f68f89 Compare October 25, 2024 05:07
@sophoah
Copy link
Contributor

sophoah commented Oct 26, 2024

@Frozen for your review and approval

@sophoah sophoah merged commit 7711bee into dev Oct 28, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants