health

package
v1.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager aggregates the signals that decide whether the TiProxy instance is serving and whether it should keep accepting new connections. Each public method below evaluates its own condition independently, so reordering one signal never silently changes another consumer's behavior.

func NewManager

func NewManager(ready func() bool, rejectCheck func() (bool, string)) *Manager

NewManager creates a Manager.

  • ready reports whether the namespace manager is ready (init phase when false).
  • rejectCheck reports whether new connections should be rejected because of memory pressure, together with a human-readable reason.

func (*Manager) Healthy

func (m *Manager) Healthy() (bool, string)

Healthy reports whether the instance is fully serving. Used by DebugHealth. It returns false (with a reason) during init, rejectConns, and graceful shutdown.

func (*Manager) PreClose

func (m *Manager) PreClose()

PreClose marks the instance as gracefully shutting down. Idempotent; safe to call from PreClose paths.

func (*Manager) RejectConns

func (m *Manager) RejectConns() (bool, string)

RejectConns reports whether new connections should be rejected and returns a reason string. Used by the proxy server and the VIP manager. It returns true only on memory pressure; graceful shutdown does NOT reject here, because the proxy keeps accepting until its listeners are closed. The VIP release on graceful shutdown is handled by PreClose.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL