feat: add PING mechanism for connection health checks; update proto and generated files

- Introduced PING code in TaskServiceConnectCode enum for health checks.
- Updated Runner to use proper PING messages instead of fake log messages for connection health checks.
- Modified TaskServiceServer to handle PING requests and acknowledge them.
- Adjusted generated gRPC files to reflect changes in proto definitions and ensure compatibility.
This commit is contained in:
Marvin Zhang
2025-08-16 17:19:21 +08:00
parent babecc46c0
commit 65aeb3ed8c
5 changed files with 275 additions and 120 deletions

View File

@@ -188,6 +188,10 @@ func (svr TaskServiceServer) Connect(stream grpc.TaskService_ConnectServer) (err
case grpc.TaskServiceConnectCode_INSERT_LOGS:
// handle task log insertion
err = svr.handleInsertLogs(taskId, msg)
case grpc.TaskServiceConnectCode_PING:
// handle connection health check ping - no action needed, just acknowledge
svr.Debugf("received ping from task[%s]", taskId.Hex())
err = nil
default:
// invalid message code received
svr.Errorf("invalid stream message code: %d", msg.Code)