Skip to content

Comments

Fix duplicate health server startup in ModelRunner#955

Open
ackizilkale wants to merge 1 commit intomasterfrom
PR-1256-health
Open

Fix duplicate health server startup in ModelRunner#955
ackizilkale wants to merge 1 commit intomasterfrom
PR-1256-health

Conversation

@ackizilkale
Copy link
Contributor

@ackizilkale ackizilkale commented Feb 20, 2026

Fix duplicate health server startup in ModelRunner

start_health_server_thread() was called twice on model load — once
unconditionally and once inside the
guard. The first call would bind the port successfully, causing the
second call to fail with OSError: [Errno 98] Address already in use.

Remove the unconditional call, keeping only the guarded one which
also correctly respects health_check_port=None to disable the server.

  • Thread-2 (first call) bound port 8080 successfully and kept running — so health probes (/healthz/liveness, /healthz/readiness) still responded correctly
  • Thread-3 (second call) crashed silently on startup and died

  start_health_server_thread() was called twice on model load — once
  unconditionally and once inside the
  guard. The first call would bind the port successfully, causing the
  second call to fail with OSError: [Errno 98] Address already in use.

  Remove the unconditional call, keeping only the guarded one which
  also correctly respects health_check_port=None to disable the server.
@ackizilkale ackizilkale requested a review from a team February 20, 2026 18:07
@github-actions
Copy link

Code Coverage

Package Line Rate Health
clarifai 45%
clarifai.cli 68%
clarifai.cli.templates 46%
clarifai.client 65%
clarifai.client.auth 67%
clarifai.constants 100%
clarifai.datasets 100%
clarifai.datasets.export 80%
clarifai.datasets.upload 75%
clarifai.datasets.upload.loaders 37%
clarifai.models 100%
clarifai.rag 0%
clarifai.runners 53%
clarifai.runners.models 64%
clarifai.runners.pipeline_steps 39%
clarifai.runners.pipelines 71%
clarifai.runners.utils 62%
clarifai.runners.utils.data_types 72%
clarifai.schema 100%
clarifai.urls 58%
clarifai.utils 60%
clarifai.utils.evaluation 16%
clarifai.workflows 95%
Summary 62% (10027 / 16299)

Minimum allowed line rate is 50%

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant