BrowsePoll retains notification sequence across subscription replacement; new queues appear only after expiry/full refresh
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 67/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- c
- Domain
- backend, networking
Research direction
Read the subscription creation and lease-expiry paths in cups-browsed, using the source excerpts in source-review.txt as a starting point; then trace how later notification requests use context->sequence_number + 1. Reproduce with the attached configuration and logs, letting a subscription expire before adding a shared dummy queue. Done when a replacement subscription tracks notifications from its own sequence position and the new queue is discovered without waiting for another full refresh.
Written by the indexing model from the issue text.
Description
Describe the bug
New shared queues on a remote CUPS server are not promptly discovered by cups-browsed despite regular BrowsePoll requests. Discovery recovers when the remote subscription expires, cups-browsed creates a replacement subscription, and it requests the full printer list.
Architecture: remote CUPS server → local CUPS server. The problem was initially observed on a remote server in our deployed environment and then in a separate container test using a 180-second default lease and 10-second polling interval.
The test uses shared dummy raw queues; no physical printer or print job is needed. This concerns queue discovery, so application names, sample documents, spool files and physical printer models are not applicable to the reproduction. The dummy upstream raw queues have no PPD.
Observed behaviour — 9 November 2026
Time - Observation
14:43:45 - Subscription 399 created; full printer-list request follows.
14:45:33 - Remote queue cb_after3 successfully added; authenticated request returns HTTP 200 / IPP successful-ok.
14:46:19 - Local lpstat -p still does not list cb_after3.
14:46:35 - Remote notification poll reports no events.
14:46:45 - Subscription 399 expires; subscription 401 created; full printer-list request follows.
14:46:46 - cb_after3 discovered, approximately 73 seconds after remote creation.
14:46:56 onward - Captured requests for replacement subscription 401 ask for sequence 1015, also seen for earlier subscription 352.
The key expiry/discovery sequence is:
14:46:45 [BrowsePoll REMOTE-IP:631]: Lease expired
14:46:45 [BrowsePoll REMOTE-IP:631]: IPP-Create-Subscription
14:46:45 [BrowsePoll REMOTE-IP:631]: subscription ID=401
14:46:45 [BrowsePoll REMOTE-IP:631]: CUPS-Get-Printers
14:46:46 Found CUPS queue/class: cb_after3 on host REMOTE-IP.
Prefixes are shortened here; the attached logs preserve the available original context. The first captured request for the replacement subscription includes:
2026-11-09T14:46:56.645674+00:00 cupsdProcessIPPRequest: notify-subscription-ids integer '401'
2026-11-09T14:46:56.645695+00:00 cupsdProcessIPPRequest: notify-sequence-numbers integer '1015'
This request is approximately 11 seconds after subscription creation. “First captured” refers to the supplied excerpts; they do not prove that no earlier request occurred. Further requests at 14:47:06 and 14:48:16 also request 1015.
The supplied excerpts do not show the requested sequence for subscription 399 or enumerate the events available on subscription 401. Delayed discovery occurred under 399; the requests for 401 show that the high requested sequence persisted after the refresh that recovered discovery. We therefore distinguish the observed behaviour from the suspected cause.
To Reproduce
- Use a separate test CUPS server and cups-browsed client. Configure the client with
BrowsePoll REMOTE-SERVER:631,BrowseInterval 10, and debug logging. SetDefaultLeaseDuration 180andLogLevel debug2on the upstream test server before starting the client. - Create and share a dummy seed queue. Generate printer-state changes and let cups-browsed consume notifications, confirming that its requested sequence advances.
- Let the remote subscription expire and be replaced without restarting cups-browsed. Wait for the accompanying full printer-list refresh to finish.
- Add and share another dummy queue, then observe notification requests and local queue availability.
- Check whether discovery occurs only at the next expiry/full refresh, and capture the requested sequence for the replacement subscription.
Exact commands and the lab's configuration template are attached in reproduction.txt, client-config-template.txt and upstream-test-settings.txt. These describe the test setup.
Expected behavior
New shared queues should be discovered through the normal notification/polling cycle without waiting for subscription expiry. Notification tracking should be initialised for a new subscription rather than retaining the previous subscription's sequence position.
System information
- Reported environment: Ubuntu 24.04;
cupsandcups-daemon2.4.7-1.2ubuntu7.14;cups-browsed2.0.0-0ubuntu10.3. - Separate test client: Ubuntu 24.04 container; cups-browsed pinned to
2.0.0-0ubuntu10.3; CUPS dependencies installed from Ubuntu repositories. - Exact upstream and test-container package inventories have not yet been captured separately. The reported versions above should not be assumed to apply to both hosts.
- Distribution binaries, not a custom cups-browsed build; custom
./configureoptions are not applicable to this test.
Latest upstream source check
Source inspection on 9 November 2026 found the missing sequence reset in both the latest release 2.1.1 (089450357e61673fa9871b927c4b3b6cea4690a1) and master (8f9b98b5f7a7f2ae073ef03d90a53b1c2c8a4a46). Successful subscription creation assigns the new ID without resetting the sequence; the expiry branch calls it and requests a full refresh. Later requests use context->sequence_number + 1.
There is a reset to zero in the separate generic-error branch, but not in the lease-expiry branch. See source-review.txt for exact source excerpts and permanent links.
Attachments and evidence limits
upstream-test-settings.txt
annotated-findings.txt
client-config-template.txt
creation-success-confirmation.txt
latest-logs.txt
reproduction.txt
source-review.txt
latest-logs.txt: latest user-supplied batch, with host/model identifiers anonymised; contains selected excerpts and gaps, not continuous logs.creation-success-confirmation.txt: later successful HTTP 200 confirmation, supplied separately from that batch; prefix omitted explicitly.annotated-findings.txt: detailed explanations alongside selected excerpts.source-review.txt: verified release/master code paths.reproduction.txt,client-config-template.txt,upstream-test-settings.txt: reproduction instructions and template configuration.
Timestamps, subscription IDs, sequence numbers and test queue names have been retained to allow correlation.
- Dominant language
- C
- Stars
- 51
- Forks
- 21
- Avg merge
- 22h 49m
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenPrinting/cups-browsed
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
OpenPrinting/cups-browsed#77 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
OpenPrinting/cups-browsed#76 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 50/100
OpenPrinting/cups-browsed#75 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
OpenPrinting/cups-browsed#71 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
OpenPrinting/cups-browsed#74 · 3 comments ·
All issues in OpenPrinting/cups-browsed
Similar issues
-
`sha256()` returns a wrong hash when libsql-ffi is built with gcc 11 or laterPossibly taken @colinhacks claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tursodatabase/libsql#2333 ·
Maintainers usually reply within 11 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OpenPrinting/cups#1826 ·
Maintainers usually reply within 1 day
-
Backport to 3.0 advertises a suffix that does not existPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
389ds/389-ds-base#8152 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RetroAchievements/rcheevos#580 · 1 comment ·
Maintainers usually reply within 5 days