mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-08-07 07:14:50 +00:00
4b5000d107
* Implement manager client heartbeat mechanism Introduced a heartbeat system in the manager service to maintain an active link with client agents. The updates involve sending periodic heartbeat signals controlled via the new environment variable `MANAGER_HEARTBEAT_INTERVAL`, defaulting to 1 second. The protobuf definitions, service interfaces, and server logic have been updated accordingly to handle the incoming signals. This change allows better tracking of active client connections and could be used for features like auto-reconnect or resource cleanup for lost connections in the future. Signed-off-by: SammyOina <sammyoina@gmail.com> * Enhance gRPC server to handle client termination Introduce the capability for the gRPC server in the manager module to process termination requests from clients. Server and client proto buffers have been updated to include a Termination message, allowing clients to signal the server to stop processing. Handling for communication and termination flows involving context cancellation have been added across server implementation, manager client, and main execution logic to properly respond to termination signals. This ensures clean shutdowns and resource deallocation when a client requests termination, improving the robustness of the system. Signed-off-by: SammyOina <sammyoina@gmail.com> * Refactor gRPC server context handling Removed the redundant storage of context in grpcServer struct and modified the NewServer constructor to exclude the context parameter. Updated the Process method to derive context from the stream directly, ensuring better context scoping and adherence to proper gRPC patterns. This change simplifies the server's context management and ensures contexts are more accurately associated with their corresponding streams, which can improve debugging and request cancellation behavior. Signed-off-by: SammyOina <sammyoina@gmail.com> * Update protoc to v4.25.3 and remove heartbeat system Upgraded protoc version to 4.25.3, ensuring compatibility with the latest protocol buffer features and potential performance improvements. Additionally, removed the entire heartbeat system, involving both its gRPC server implementation and associated client-side logic. This elimination suggests a shift in the service health-check strategy, potentially to a more modern or efficient model. Signed-off-by: SammyOina <sammyoina@gmail.com> * Removed heartbeat functionality for manager service The heartbeat feature and its related configuration have been removed across the application. This includes the removal of the Heartbeat method from the Service interface, the associated interval setting in the config structure, and related environment variable documentation. The change implies an architectural shift towards alternative methods of service availability checking or potentially a move to stateless service design. The cleanup removes unnecessary code, thus simplifying the overall service logic. Signed-off-by: SammyOina <sammyoina@gmail.com> * Introduce Terminate message and streamline gRPC server logic - Added a new `Terminate` protobuf message to handle termination requests more explicitly. - Removed redundant context cancels in gRPC server stream processing to rely on context propagation. - Updated channel usage to match the altered stream message types; this aligns message handling with the updated protobuf definitions. - Passed client authentication info to service run function to enhance the security during service execution. - Utilized stream's context directly in error groups for improved clarity and error handling scope. - Refactored message descriptors in protobuf to maintain correct ordering after introducing new message types. These changes enhance the codebase's maintainability, simplify the logic, and align with the updated messaging protocol. Signed-off-by: SammyOina <sammyoina@gmail.com> * Update agent configuration in main.go Signed-off-by: SammyOina <sammyoina@gmail.com> --------- Signed-off-by: SammyOina <sammyoina@gmail.com>