Skip to content

LIST ACTIVE: answer 403 when no news server gave a first list - #383

Merged
go-while merged 9 commits into
mainfrom
fix/list-active-refused
Nov 16, 2026
Merged

go-while merged 9 commits into
mainfrom
fix/list-active-refused

Conversation

@go-while

@go-while go-while commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

When the news server refuses LIST ACTIVE (or can't be reached) and the cache has no active list yet, NewsCache answered 215 with an empty list: clients saw a server without groups. It now answers 403 (RFC 3977 3.2.1: a temporary problem, try again later).

Before: the failed first fill set the retry mark (ACTIVE_RETRY_SECONDS), so the empty list looked fresh to this session and every other one for 60 s. LIST ACTIVE, LIST ACTIVE.TIMES and NEWGROUPS sent nothing.

Now (CServer::active, NServer.cc):

  • A first fill that got a list from no server keeps the first-fill mark, writes its time into the refresh lock file (.active.refresh, 8 bytes) and reports the list as missing (CServer::active_missing()).
  • A session that waited for the lock, or asks within the retry time, finds that time and doesn't ask the servers again (no serial re-fetches by waiting sessions). The retry time is the same as the existing retry mark's: ACTIVE_RETRY_SECONDS (60), or the active TTL (Timeouts) if shorter. After it the next session fetches.
  • The manual's note on .active.refresh ("holds no data") is updated.
  • updatenews -a (wait_for_refresh) always fetches.
  • A list that exists, or a partial first fill where one server gave its whole list, keeps the retry mark as before. With several Read patterns a server counts only once every pattern's reply was read (one pattern answered, then a refusal, gave no list).
  • LIST ACTIVE [wildmat], LIST, LIST ACTIVE.TIMES and NEWGROUPS answer 403 the news server gave no active list, try again later. GROUP is unaffected.

Tests: TestListActiveRefusedOnePattern (one Read pattern answered with no groups, the next one and plain LIST ACTIVE refused: 403, not an empty 215) and TestListActiveRefusedFreshCache (tests/e2e/active_test.go): upstream refuses both list active * and list active; the five commands get 403; a second session gets 403 without a new upstream LIST ACTIVE (normal build); GROUP still 211; in the short-limit build, after the 2-second retry time a new session gets the list.

Test-host runs (jobq.sh, head 0f5a8a3): Debian 13 full make check PASS; Fedora 46 short-limit build, the active/deadline tests PASS; main + the new test only on Fedora 45: FAIL as expected (empty 215).

council r2: terra 9.5, sonnet 9 (r1: sonnet 5, terra 6, fable 9); fresh check at 366083f: sonnet 8, luna-low 9, luna-high 10, luna-max 8 (found the Read-pattern case, fixed in 2db3b65). Test-host runs at 2db3b65: Debian 13 make check PASS; the new test fails on 366083f (empty 215).

🤖 Generated with Claude Code

go-while and others added 6 commits November 16, 2026 00:56
When the news server refused LIST ACTIVE (or could not be reached)
and the cache had no active list yet, CServer::active set the retry
mark, which made the empty list look fresh: LIST ACTIVE, LIST
ACTIVE.TIMES and NEWGROUPS answered 215/231 with nothing, as if the
server had no groups, in that session and every other one for
ACTIVE_RETRY_SECONDS.

Now a first fill that got a list from no server keeps the first-fill
mark, records the time in the refresh lock file (.active.refresh) and
reports the list as missing; those commands answer 502. A session that
waited for the lock, or comes within ACTIVE_RETRY_SECONDS (60), finds
that time and answers 502 without asking the servers again; after that
the next session fetches. updatenews -a still always fetches. A list
that exists keeps the retry mark as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
go vet (run by go test) rejects a variable as client.Conn.Cmd's format.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The failed first fill's time held other tries off for
ACTIVE_RETRY_SECONDS even when Timeouts gives the active list a
shorter TTL; the retry mark for a list that exists uses the shorter of
the two. With Timeouts 1, TestUpstreamCutOffActive's second session
two seconds later was no longer sent upstream. Use the same shorter
time. The manual said .active.refresh holds no data: it now holds that
time. (Review council round 1, Sonnet.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its short-build part (the list fetched again after the 2-second retry
time) ran nowhere: the step has a fixed list of tests. (Review council
round 1, Fable.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RFC 3977 3.2.1: 502 is permanent, 403 a temporary problem; the client
may ask again once the news server gives its list. (Maintainer's
choice, 2026-11-16.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Other failures answer 403 as well; only this case's reply ('no active
list') shows that the missing list was detected. (Review council,
Sonnet.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@go-while go-while changed the title LIST ACTIVE: answer 502 when no news server gave a first list LIST ACTIVE: answer 403 when no news server gave a first list Nov 16, 2026
go-while and others added 3 commits November 16, 2026 07:02
Comments only. (Review council round 2, Sonnet's note.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…erns

With several Read patterns, any_complete was set after each pattern's
reply. A server that answered the first pattern (with no groups) and
then refused the next pattern and the plain LIST ACTIVE counted as
having given its list, so on a fresh cache LIST ACTIVE answered an
empty 215 again instead of 403. Now the server counts once every
pattern's reply was read. TestListActiveRefusedOnePattern.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@go-while
go-while merged commit 315d0dd into main Nov 16, 2026
31 checks passed
@go-while
go-while deleted the fix/list-active-refused branch November 16, 2026 20:55
go-while added a commit that referenced this pull request Nov 17, 2026
The councils aimed at 9.5 (not every round reached it), #387 bumped
vmactions/freebsd-vm, and the Read-pattern problem in #383 came from a
fresh check, not the council.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
go-while added a commit that referenced this pull request Nov 17, 2026
go-while added a commit that referenced this pull request Nov 17, 2026
…1.3.23

Folds the changes/ entries merged into main since the last sync and
removes them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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