Worker logs egress allowlist write warnings on every task when egress isolation is off

Open
#89 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start with _apply_task_egress and the egress window and orphan-sweep paths in client/src/orcaster_worker/main.py; read how proxy settings are detected at startup and how the allowlist is written and cleared. Check the existing egress tests and add coverage for both proxy variables being absent, either one being set, and a failed write with a proxy configured. Done when the startup message and write behavior meet the acceptance criteria and a CHANGELOG entry is added under Unreleased.

Written by the indexing model from the issue text.

Description

client enhancement P3

Problem

The README tells developers to start a local worker with make up client EGRESS_ISOLATION=0 (README.md:225, client/README.md:777). In that mode the egress volume is not mounted, so the allowlist path is on a read-only file system.

With ORCH_ENFORCE_ISOLATION on (the default, client/src/orcaster_worker/config.py:465), a task without egress_allowlist still gets an empty list, so the worker writes the per-task allowlist on every task. It writes once when the egress window opens (client/src/orcaster_worker/main.py:1332) and again when it closes. The close runs twice in the normal path (main.py:645-682, main.py:1441, main.py:1561). Each failed write logs:

WARNING orcaster.worker failed to write egress allowlist file ...: [Errno 30] Read-only file system

(main.py:639-642). A healthy task therefore logs the same warning three times. The docstring of _apply_task_egress already says that in this mode the file is irrelevant because no proxy reads it (main.py:618-626).

The same warning is the only signal when a proxy is configured and the write really fails. Operators learn to ignore it during development.

The worker already detects whether a proxy is configured at startup, from HTTPS_PROXY and HTTP_PROXY (main.py:777-795).

Proposed change

  1. At startup, decide once whether a proxy reads the allowlist: a proxy is configured when HTTPS_PROXY or HTTP_PROXY is set in the worker environment, the same test as main.py:789.
  2. When no proxy is configured, log one INFO line at startup, for example egress isolation off: per-task allowlist is not written, and skip the per-task writes and clears, including the orphan sweep at boot (main.py:798, main.py:828).
  3. When a proxy is configured, keep every write and keep the WARNING on a failed write, exactly as today.

Compatibility

  • Workers with egress isolation on have HTTPS_PROXY and HTTP_PROXY set by make up client (Makefile:466-473). They keep writing the signed per-task allowlist and keep the WARNING. Their behavior does not change.
  • Workers without a proxy only lose log lines. The task result is the same, because the write failure was already ignored.
  • The detection must never treat a worker with a proxy as "no proxy", because then the proxy would keep a stale allowlist and tasks would fail closed. Only the absence of both variables turns the writes off.
  • No configuration change and no new setting.

Acceptance criteria

  • A worker without HTTPS_PROXY and HTTP_PROXY logs one startup line about the allowlist and no failed to write egress allowlist line for a task that completes.
  • A worker with HTTPS_PROXY or HTTP_PROXY set writes and clears the allowlist as today (existing egress tests pass unchanged).
  • With a proxy configured and an unwritable allowlist file, the WARNING is still logged (test).
  • A test pins that only the absence of both proxy variables disables the writes.
  • Existing deployments keep working without config changes.
  • CHANGELOG entry under Unreleased.
Dominant language
Python
Stars
0
Forks
0
Avg merge
1d 1h
Merged PRs (30d)
10

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AInvirion/orcaster

All issues in AInvirion/orcaster

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.