Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for proxy exiting early during start-up #373

Merged
merged 1 commit into from
Jan 30, 2025
Merged

Fix for proxy exiting early during start-up #373

merged 1 commit into from
Jan 30, 2025

Conversation

alexellis
Copy link
Member

Description

Fix for proxy exiting early during start-up

Motivation and Context

When a proxied core service was accessed before it was ready to accept a connection, due to a start-up, restart, etc of a core service, then the proxy exited instead of continuing to accept new connections.

This meant having to restart faasd and hope the race condition worked itself out, or that no incoming requests were made.

Tested with Grafana, which seemed to manifest the issue the most.

Jan 30 08:58:09 derek faasd[1684930]: 2025/01/30 08:58:09 Proxy from: 127.0.0.1:8080, to: gateway:8080 (10.62.1.184)
Jan 30 08:58:09 derek faasd[1684930]: 2025/01/30 08:58:09 Proxy from: 127.0.0.1:8083, to: dashboard:8083 (10.62.1.185)
Jan 30 08:58:09 derek faasd[1684930]: 2025/01/30 08:58:09 Proxy from: 10.62.0.1:5432, to: postgresql:5432 (10.62.1.187)
Jan 30 08:58:09 derek faasd[1684930]: 2025/01/30 08:58:09 Proxy from: 127.0.0.1:9090, to: prometheus:9090 (10.62.1.183)
Jan 30 08:58:09 derek faasd[1684930]: 2025/01/30 08:58:09 Proxy from: 127.0.0.1:3000, to: grafana:3000 (10.62.1.189)
Jan 30 08:58:10 derek faasd[1684930]: 2025/01/30 08:58:10 Unable to dial: 10.62.1.189:3000, error: dial tcp 10.62.1.189:3000: connect: connection refused

How Has This Been Tested?

After the fix, the warning is still logged, but the proxy continues to accept new connections.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

When a proxied core service was accessed before it was ready
to accept a connection, due to a start-up, restart, etc of
a core service, then the proxy exited instead of continuing
to accept new connections.

This meant having to restart faasd and hope the race condition
worked itself out, or that no incoming requests were made.

Tested with Grafana, which seemed to manifest the issue
the most.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
@alexellis alexellis merged commit d7e0beb into master Jan 30, 2025
1 check passed
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