fix: extend edge trace idle timeout (#1346)
This commit is contained in:
@@ -14,6 +14,7 @@ test("edge proxy reports local health and proxies live health to upstream", asyn
|
|||||||
assert.equal(health.status, "ok");
|
assert.equal(health.status, "ok");
|
||||||
assert.equal(health.service.role, "public-dev-ingress");
|
assert.equal(health.service.role, "public-dev-ingress");
|
||||||
assert.equal(health.details.upstream, `http://127.0.0.1:${upstream.port}`);
|
assert.equal(health.details.upstream, `http://127.0.0.1:${upstream.port}`);
|
||||||
|
assert.equal(health.details.idleTimeoutSeconds, 120);
|
||||||
assert.equal(health.details.mode, "dev-edge-proxy");
|
assert.equal(health.details.mode, "dev-edge-proxy");
|
||||||
|
|
||||||
const routes = await fetchJson(`http://127.0.0.1:${proxy.port}/routes`);
|
const routes = await fetchJson(`http://127.0.0.1:${proxy.port}/routes`);
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ const proxyTimeoutMs = parseTimeout(process.env.HWLAB_EDGE_PROXY_TIMEOUT_MS, 126
|
|||||||
min: 1000,
|
min: 1000,
|
||||||
max: 2400000
|
max: 2400000
|
||||||
});
|
});
|
||||||
|
const idleTimeoutSeconds = parseTimeout(process.env.HWLAB_EDGE_IDLE_TIMEOUT_SECONDS, 120, {
|
||||||
|
min: 1,
|
||||||
|
max: 255
|
||||||
|
});
|
||||||
const { host, port } = resolveHostPort({
|
const { host, port } = resolveHostPort({
|
||||||
listenEnv: "HWLAB_EDGE_LISTEN",
|
listenEnv: "HWLAB_EDGE_LISTEN",
|
||||||
hostEnv: "HWLAB_EDGE_HOST",
|
hostEnv: "HWLAB_EDGE_HOST",
|
||||||
@@ -21,6 +25,7 @@ function proxyDetails() {
|
|||||||
return {
|
return {
|
||||||
upstream,
|
upstream,
|
||||||
timeoutMs: proxyTimeoutMs,
|
timeoutMs: proxyTimeoutMs,
|
||||||
|
idleTimeoutSeconds,
|
||||||
mode: "dev-edge-proxy"
|
mode: "dev-edge-proxy"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -34,6 +39,7 @@ function parseTimeout(value, fallback, { min, max }) {
|
|||||||
const server = Bun.serve({
|
const server = Bun.serve({
|
||||||
hostname: host,
|
hostname: host,
|
||||||
port,
|
port,
|
||||||
|
idleTimeout: idleTimeoutSeconds,
|
||||||
async fetch(request, bunServer) {
|
async fetch(request, bunServer) {
|
||||||
const url = new URL(request.url);
|
const url = new URL(request.url);
|
||||||
|
|
||||||
|
|||||||
@@ -494,6 +494,7 @@ services:
|
|||||||
HWLAB_EDGE_LISTEN: 0.0.0.0:6667
|
HWLAB_EDGE_LISTEN: 0.0.0.0:6667
|
||||||
HWLAB_EDGE_UPSTREAM: http://hwlab-cloud-api.hwlab-dev.svc.cluster.local:6667
|
HWLAB_EDGE_UPSTREAM: http://hwlab-cloud-api.hwlab-dev.svc.cluster.local:6667
|
||||||
HWLAB_EDGE_PROXY_TIMEOUT_MS: "1260000"
|
HWLAB_EDGE_PROXY_TIMEOUT_MS: "1260000"
|
||||||
|
HWLAB_EDGE_IDLE_TIMEOUT_SECONDS: "120"
|
||||||
- serviceId: hwlab-agent-skills
|
- serviceId: hwlab-agent-skills
|
||||||
namespace: hwlab-dev
|
namespace: hwlab-dev
|
||||||
healthPath: /health/live
|
healthPath: /health/live
|
||||||
|
|||||||
Reference in New Issue
Block a user