add extra debug logs

This commit is contained in:
mlsmaycon
2026-01-28 21:26:57 +01:00
parent 5b1fced872
commit a0a61d4f47
2 changed files with 5 additions and 2 deletions

View File

@@ -251,7 +251,7 @@ func (s *ProxyServiceServer) SendReverseProxyUpdate(update *proto.ProxyMapping)
conn := value.(*proxyConnection) conn := value.(*proxyConnection)
select { select {
case conn.sendChan <- update: case conn.sendChan <- update:
log.Debugf("Sent reverse proxy update to proxy %s", conn.proxyID) log.Debugf("Sent reverse proxy update with id %s to proxy %s", update.Id, conn.proxyID)
default: default:
log.Warnf("Failed to send reverse proxy update to proxy %s (channel full)", conn.proxyID) log.Warnf("Failed to send reverse proxy update to proxy %s (channel full)", conn.proxyID)
} }

View File

@@ -170,6 +170,7 @@ func (s *Server) newManagementMappingWorker(ctx context.Context, client proto.Pr
StartedAt: timestamppb.New(s.startTime), StartedAt: timestamppb.New(s.startTime),
}) })
if err != nil { if err != nil {
log.WithError(err).Warn("Could not get mapping updates, will retry")
backoffDuration := b.Duration() backoffDuration := b.Duration()
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"backoff": backoffDuration, "backoff": backoffDuration,
@@ -178,6 +179,7 @@ func (s *Server) newManagementMappingWorker(ctx context.Context, client proto.Pr
time.Sleep(backoffDuration) time.Sleep(backoffDuration)
continue continue
} }
log.Debug("Got mapping updates client from management server")
err = s.handleMappingStream(ctx, mappingClient) err = s.handleMappingStream(ctx, mappingClient)
backoffDuration := b.Duration() backoffDuration := b.Duration()
switch { switch {
@@ -185,6 +187,7 @@ func (s *Server) newManagementMappingWorker(ctx context.Context, client proto.Pr
errors.Is(err, context.DeadlineExceeded): errors.Is(err, context.DeadlineExceeded):
// Context is telling us that it is time to quit so gracefully exit here. // Context is telling us that it is time to quit so gracefully exit here.
// No need to log the error as it is a parent context causing this return. // No need to log the error as it is a parent context causing this return.
log.Debugf("Got context error, will exit loop: %v", err)
return return
case err != nil: case err != nil:
// Log the error and then retry the connection. // Log the error and then retry the connection.
@@ -217,7 +220,6 @@ func (s *Server) handleMappingStream(ctx context.Context, mappingClient proto.Pr
// Something has gone horribly wrong, return and hope the parent retries the connection. // Something has gone horribly wrong, return and hope the parent retries the connection.
return fmt.Errorf("receive msg: %w", err) return fmt.Errorf("receive msg: %w", err)
} }
log.Debug("Received mapping update, starting processing") log.Debug("Received mapping update, starting processing")
// Process msg updates sequentially to avoid conflict, so block // Process msg updates sequentially to avoid conflict, so block
// additional receiving until this processing is completed. // additional receiving until this processing is completed.
@@ -226,6 +228,7 @@ func (s *Server) handleMappingStream(ctx context.Context, mappingClient proto.Pr
"type": mapping.GetType(), "type": mapping.GetType(),
"domain": mapping.GetDomain(), "domain": mapping.GetDomain(),
"path": mapping.GetPath(), "path": mapping.GetPath(),
"id": mapping.GetId(),
}).Debug("Processing mapping update") }).Debug("Processing mapping update")
switch mapping.GetType() { switch mapping.GetType() {
case proto.ProxyMappingUpdateType_UPDATE_TYPE_CREATED: case proto.ProxyMappingUpdateType_UPDATE_TYPE_CREATED: