Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.

[Consul] Provide service ID to health check #97

Description

@leoshusar

When service isn't shut down gracefully and therefore not deregistered from consul, when the new instance is spawned on the same host:port, Consul doesn't know which instance is actually alive. So all zombie instances send pings to the same healthy single instance and since they get 200, Consul thinks all instances are alive.
image

I tried to attach ServiceID either as query param or header (since Consul supports custom headers), and in the ping endpoint checked if the received ID matches the actual service ID.
If it matches, it returns 200, otherwise 404, and it works. Consul receives 200 only from the single alive instance.
image

So my proposal is to add either query param or some header with Convey's ServiceId to health checks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions