Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors Service Manager (SM) message handling to better separate stream reading from message processing (CM-side), consolidates error logging for incoming messages (SM-side), and tweaks a default CM timeout.
Changes:
SMClient: consolidate per-message error handling into a singleError err+ shared log path.SMHandler: split stream reading and message processing into two threads with a mutex/condvar-protected queue.config: reducecDefaultUnitStatusSendTimeoutfrom30sto10s.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/sm/smclient/smclient.cpp |
Simplifies incoming message dispatch by centralizing error logging. |
src/cm/smcontroller/smhandler.hpp |
Introduces queue/condvar + two-thread model fields for outgoing message handling. |
src/cm/smcontroller/smhandler.cpp |
Implements read thread that enqueues messages and a processing thread that drains the queue. |
src/cm/config/config.cpp |
Lowers default unit status send timeout to 10 seconds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When sync responses and incoming messages are processed in one thread, it may lead to dead lock when some module hold its mutex while sending sync message and at this time it receives incoming message that also processed under same mutex. This is usual pattern in our implementation. Add queue for incoming messages and process it in separate thread. It allows to avoid above dead lock. Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Disk quota is set in blocks of 1024 bytes. Update SetUserQuota and runtime container monitoring accordingly. Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Static analysis doesn't require build and could be performed first to fail as soon as any issue detected. Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.