-
First off, THANK YOU for sharing this as open source! I'm trying to create a simple reverse proxy that gets its configuration from an API. I took the The reason I want to write my own code instead of just using Traefik or NGINX is that I’m building a kind of Function-as-a-Service system. When a request hits a deployment in Kubernetes that doesn’t exist yet, I dynamically create the Deployment and Service, then keep polling the service until it’s up and responding. This kind of works — and that’s where my question comes into play. If I open two browsers:
I’ve tweaked every single parameter I can find in Pingora, but no matter what I do, I get stuck in this strange state where, once Pingora sees an error, it always returns “Connection refused” for 10–11 seconds. Then everything works — even though I’m 100% certain the service is up and responding well before those 10 seconds have passed. Is there some kind of hardcoded value in Pingora? Or a config setting I’m missing somewhere? Here’s what’s happening in the logs below: I hit It just feels wrong — or at least weird — that it’s always 10–11 seconds. That makes me think there’s some internal cache or hardcoded delay somewhere. Any help in figuring out what I’m missing is greatly appreciated. Logs
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Why do I always find the error after posting... Self crashing nodejs test server``` const http = require('http'); const { hostname } = require('os'); const path = require('path');function startWebServer() { setInterval(() => {
|
Beta Was this translation helpful? Give feedback.
Why do I always find the error after posting...
I made a small test server that "crashes" after each request so I could test the retry logic, and it works perfectly. The problem must be in Kubernetes. Sorry for the trouble.
Self crashing nodejs test server
``` const http = require('http'); const { hostname } = require('os'); const path = require('path');function startWebServer() {
const server = http.createServer(async (req, res) => {
res.setHeader('Content-Type', 'application/json');
const result = {
ok: true,
dt: new Date(),
hostname: hostname(),
method: req.method,
url: req.url,
headers: req.headers,
}
res.end(JSON.stringify(result));
console.log(
Request received: ${req.method} ${req…