Skip to content

feat(config): Expose periodic_checks in ClusterClientConfiguration #485

Description

@currantw

Describe the feature

The periodic_checks configuration option is supported by glide-core and exposed in the Python and Java GLIDE clients, but is not yet surfaced in the C# cluster client's configuration.

In rust/src/ffi.rs, the field is hardcoded to None:

periodic_checks: None,

The C# ConnectionConfig FFI struct does not include this field, and there is no corresponding builder method in ClusterClientConfiguration.

Use Case

Cluster users need to configure how often the client performs periodic topology and health checks. This is important for:

  • Detecting cluster topology changes (node additions/removals, slot migrations)
  • Tuning the balance between freshness of cluster state and network overhead
  • Disabling periodic checks entirely when not needed
  • Matching the behavior available in other GLIDE clients (Python, Java)

Proposed Solution

  • Add periodic_checks fields to the C# ConnectionConfig FFI struct in FFI.structs.cs
  • Add builder methods to ClusterClientConfiguration (cluster-only, matching Java's AdvancedGlideClusterClientConfiguration)
  • Support three modes: enabled with default interval, enabled with custom interval, and disabled
  • Pass the value through to glide-core in ffi.rs
  • Add unit test for the configuration option

References:

  • Python: glide_shared/config.pyperiodic_checks with PeriodicChecksStatus and PeriodicChecksManualInterval
  • Java: AdvancedGlideClusterClientConfiguration.javaprivate final PeriodicChecksConfig periodicChecks
  • glide-core protobuf: periodic_checks_manual_interval (field 11), periodic_checks_disabled (field 12)

Related

Additional Information

This is cluster-only configuration. In Java, it lives in AdvancedGlideClusterClientConfiguration with a default of PeriodicChecksStatus.ENABLED_DEFAULT_CONFIGS.

Metadata

Metadata

Assignees

Labels

coreCore library (`sources/Valkey.Glide/`)

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions