Skip to content

Commit 853c7f2

Browse files
authored
Merge branch 'ndyakov/feature/CAE-1313-maint-cluster' into ndyakov/CAE-1910-proxy-tests
2 parents 1902cbb + a85dafc commit 853c7f2

File tree

5 files changed

+27
-14
lines changed

5 files changed

+27
-14
lines changed

extra/redisotel/metrics.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ func milliseconds(d time.Duration) float64 {
330330

331331
func statusAttr(err error) attribute.KeyValue {
332332
if err != nil {
333+
if err == redis.Nil {
334+
return attribute.String("status", "nil")
335+
}
333336
return attribute.String("status", "error")
334337
}
335338
return attribute.String("status", "ok")

internal/maintnotifications/logs/log_messages.go

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,19 +293,29 @@ func OperationNotTracked(connID uint64, seqID int64) string {
293293

294294
// Connection pool functions
295295
func RemovingConnectionFromPool(connID uint64, reason error) string {
296-
message := fmt.Sprintf("conn[%d] %s due to: %v", connID, RemovingConnectionFromPoolMessage, reason)
297-
return appendJSONIfDebug(message, map[string]interface{}{
296+
metadata := map[string]interface{}{
298297
"connID": connID,
299-
"reason": reason.Error(),
300-
})
298+
"reason": "unknown", // this will be overwritten if reason is not nil
299+
}
300+
if reason != nil {
301+
metadata["reason"] = reason.Error()
302+
}
303+
304+
message := fmt.Sprintf("conn[%d] %s due to: %v", connID, RemovingConnectionFromPoolMessage, reason)
305+
return appendJSONIfDebug(message, metadata)
301306
}
302307

303308
func NoPoolProvidedCannotRemove(connID uint64, reason error) string {
304-
message := fmt.Sprintf("conn[%d] %s due to: %v", connID, NoPoolProvidedMessageCannotRemoveMessage, reason)
305-
return appendJSONIfDebug(message, map[string]interface{}{
309+
metadata := map[string]interface{}{
306310
"connID": connID,
307-
"reason": reason.Error(),
308-
})
311+
"reason": "unknown", // this will be overwritten if reason is not nil
312+
}
313+
if reason != nil {
314+
metadata["reason"] = reason.Error()
315+
}
316+
317+
message := fmt.Sprintf("conn[%d] %s due to: %v", connID, NoPoolProvidedMessageCannotRemoveMessage, reason)
318+
return appendJSONIfDebug(message, metadata)
309319
}
310320

311321
// Circuit breaker functions

maintnotifications/e2e/scenario_endpoint_types_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ func TestEndpointTypesPushNotifications(t *testing.T) {
332332
p("Bind action completed for %s: %s %s", endpointTest.name, bindStatus.Status, actionOutputIfFailed(bindStatus))
333333

334334
// Continue traffic for analysis
335-
time.Sleep(30 * time.Second)
335+
time.Sleep(60 * time.Second)
336336
commandsRunner.Stop()
337337

338338
// Analyze results for this endpoint type

maintnotifications/e2e/scenario_tls_configs_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import (
1313
"github.com/redis/go-redis/v9/maintnotifications"
1414
)
1515

16-
// TODO ADD TLS CONFIGS
1716
// TestTLSConfigurationsPushNotifications tests push notifications with different TLS configurations
18-
func ТestTLSConfigurationsPushNotifications(t *testing.T) {
17+
func TestTLSConfigurationsPushNotifications(t *testing.T) {
18+
t.Skip("Test disabled due to tls environment missing in test environment")
1919
if os.Getenv("E2E_SCENARIO_TESTS") != "true" {
2020
t.Skip("Scenario tests require E2E_SCENARIO_TESTS=true")
2121
}

maintnotifications/handoff_worker.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,9 +501,9 @@ func (hwm *handoffWorkerManager) closeConnFromRequest(ctx context.Context, reque
501501
internal.Logger.Printf(ctx, logs.RemovingConnectionFromPool(conn.GetID(), err))
502502
}
503503
} else {
504-
err := conn.Close() // Close the connection if no pool provided
505-
if err != nil {
506-
internal.Logger.Printf(ctx, "redis: failed to close connection: %v", err)
504+
errClose := conn.Close() // Close the connection if no pool provided
505+
if errClose != nil {
506+
internal.Logger.Printf(ctx, "redis: failed to close connection: %v", errClose)
507507
}
508508
if internal.LogLevel.WarnOrAbove() {
509509
internal.Logger.Printf(ctx, logs.NoPoolProvidedCannotRemove(conn.GetID(), err))

0 commit comments

Comments
 (0)