feat: Worker Connectivity Health Check (#3650)

* feat: Worker Connectivity Health Check

Add worker upstream connection state. API calls to the worker's ops `/heath?worker_info=1` endpoint should now return a new filed called `upstream_connection_state`

```
{
   "worker_process_info":{
      "state":"active",
      "active_session_count":0,
      "upstream_connection_state":"READY"
   }
}
```

The states returned will be GRPC connection states: https://grpc.github.io/grpc/core/md_doc_connectivity-semantics-and-api.html

There could be multiple upstream addresses but GRPC manual resolver determines the state of the connection.
This commit is contained in:
Elim Tsiagbey authored and GitHub committed 2023-09-01 13:42:41 -04:00
1 parent c55df52d44
commit fabd4093de
8 files changed
+272 -59

No files matched your search

+6 -4
View File
@@ -127,10 +127,11 @@ type Worker struct {
recorderManager recorderManager
everAuthenticated *ua.Uint32
lastStatusSuccess *atomic.Value
workerStartTime time.Time
operationalState *atomic.Value
everAuthenticated *ua.Uint32
lastStatusSuccess *atomic.Value
workerStartTime time.Time
operationalState *atomic.Value
upstreamConnectionState *atomic.Value
controllerMultihopConn *atomic.Value
@@ -207,6 +208,7 @@ func New(ctx context.Context, conf *Config) (*Worker, error) {
pkiConnManager: cluster.NewDownstreamManager(),
successfulStatusGracePeriod: new(atomic.Int64),
statusCallTimeoutDuration: new(atomic.Int64),
upstreamConnectionState: new(atomic.Value),
}
w.operationalState.Store(server.UnknownOperationalState)