From 19cfa1e3012d6a2d8f36fd3970dd499b0a21fd41 Mon Sep 17 00:00:00 2001 From: Maddie Gordon <50681653+madelinegordon@users.noreply.github.com> Date: Wed, 1 Jun 2022 17:47:13 -0700 Subject: [PATCH 1/2] Revert "remove todo" This reverts commit 877700702026bdbfdbab1cb46632c5e88285c0fb. --- src/proto/FunctionRpc.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/proto/FunctionRpc.proto b/src/proto/FunctionRpc.proto index 72f5069..9ecbeb3 100644 --- a/src/proto/FunctionRpc.proto +++ b/src/proto/FunctionRpc.proto @@ -147,6 +147,8 @@ message StatusResult { repeated RpcLog logs = 3; } +// TODO: investigate grpc heartbeat - don't limit to grpc implementation + // Warning before killing the process after grace_period // Worker self terminates ..no response on this message WorkerTerminate { From d73b877b56dfb1184886f9f8e4e3c58cee330a62 Mon Sep 17 00:00:00 2001 From: Maddie Gordon <50681653+madelinegordon@users.noreply.github.com> Date: Wed, 1 Jun 2022 17:49:05 -0700 Subject: [PATCH 2/2] revert first commit --- src/proto/FunctionRpc.proto | 43 +++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/src/proto/FunctionRpc.proto b/src/proto/FunctionRpc.proto index 9ecbeb3..b14ec87 100644 --- a/src/proto/FunctionRpc.proto +++ b/src/proto/FunctionRpc.proto @@ -26,18 +26,21 @@ message StreamingMessage { oneof content { // Worker initiates stream - StartStream start_stream = 20; + StartStream start_stream = 20; // Host sends capabilities/init data to worker WorkerInitRequest worker_init_request = 17; // Worker responds after initializing with its capabilities & status WorkerInitResponse worker_init_response = 16; + // Worker periodically sends empty heartbeat message to host + WorkerHeartbeat worker_heartbeat = 15; + // Host sends terminate message to worker. // Worker terminates if it can, otherwise host terminates after a grace period WorkerTerminate worker_terminate = 14; - // Host periodically sends status request to the worker + // Add any worker relevant status to response WorkerStatusRequest worker_status_request = 12; WorkerStatusResponse worker_status_response = 13; @@ -46,25 +49,25 @@ message StreamingMessage { // Worker requests a desired action (restart worker, reload function) WorkerActionResponse worker_action_response = 7; - + // Host sends required metadata to worker to load function FunctionLoadRequest function_load_request = 8; // Worker responds after loading with the load result FunctionLoadResponse function_load_response = 9; - + // Host requests a given invocation InvocationRequest invocation_request = 4; // Worker responds to a given invocation InvocationResponse invocation_response = 5; - // Host sends cancel message to attempt to cancel an invocation. + // Host sends cancel message to attempt to cancel an invocation. // If an invocation is cancelled, host will receive an invocation response with status cancelled. InvocationCancel invocation_cancel = 21; // Worker logs a message back to the host RpcLog rpc_log = 2; - + FunctionEnvironmentReloadRequest function_environment_reload_request = 25; FunctionEnvironmentReloadResponse function_environment_reload_response = 26; @@ -88,7 +91,7 @@ message StreamingMessage { // Process.Start required info // connection details // protocol type -// protocol version +// protocol version // Worker sends the host information identifying itself message StartStream { @@ -96,7 +99,7 @@ message StartStream { string worker_id = 2; } -// Host requests the worker to initialize itself +// Host requests the worker to initialize itself message WorkerInitRequest { // version of the host sending init request string host_version = 1; @@ -147,7 +150,10 @@ message StatusResult { repeated RpcLog logs = 3; } -// TODO: investigate grpc heartbeat - don't limit to grpc implementation +// TODO: investigate grpc heartbeat - don't limit to grpc implemention + +// Message is empty by design - Will add more fields in future if needed +message WorkerHeartbeat {} // Warning before killing the process after grace_period // Worker self terminates ..no response on this @@ -179,12 +185,12 @@ message FileChangeEventRequest { // Indicates whether worker reloaded successfully or needs a restart message WorkerActionResponse { - // indicates whether a restart is needed, or reload successfully + // indicates whether a restart is needed, or reload succesfully enum Action { Restart = 0; Reload = 1; } - + // action for this response Action action = 1; @@ -192,12 +198,11 @@ message WorkerActionResponse { string reason = 2; } -// Used by the host to determine worker health -message WorkerStatusRequest { +// NOT USED +message WorkerStatusRequest{ } -// Worker responds with status message -// TODO: Add any worker relevant status to response +// NOT USED message WorkerStatusResponse { } @@ -266,7 +271,7 @@ message RpcFunctionMetadata { // base directory for the Function string directory = 1; - + // Script file specified string script_file = 2; @@ -487,7 +492,7 @@ message BindingInfo { DataType data_type = 4; } -// Used to send logs back to the Host +// Used to send logs back to the Host message RpcLog { // Matching ILogger semantics // https://github.com/aspnet/Logging/blob/9506ccc3f3491488fe88010ef8b9eb64594abf95/src/Microsoft.Extensions.Logging/Logger.cs @@ -538,7 +543,7 @@ message RpcLog { map propertiesMap = 9; } -// Encapsulates an Exception +// Encapsulates an Exception message RpcException { // Source of the exception string source = 3; @@ -600,7 +605,7 @@ message RpcHttpCookie { // TODO - solidify this or remove it message RpcHttp { string method = 1; - string url = 2; + string url = 2; map headers = 3; TypedData body = 4; map params = 10;