Skip to content

wurk v1.9.0

Choose a tag to compare

@github-actions github-actions released this 29 Oct 21:22
81bfcc1

Changed

  • concurrent-ruby is no longer a runtime dependency. wurk.gemspec dropped spec.add_dependency 'concurrent-ruby', '~> 1.2': Wurk never required it directly. An app that pulls it in through Rails or another gem keeps it; nothing else in the dependency set moved (#792).
  • Dashboard metrics history is 30 days, not 3. Wurk::Metrics::History::MID_TERM moved from 3 days to 30 days, so every 10-minute j|… bucket now lives ten times longer — up to 4320 keys per 30-day window instead of 432 per 3 days — and the dashboard's 7d/30d tabs are backed by data end-to-end. Sidekiq's ExecutionTracker keeps the 3-day TTL upstream; this is a deliberate divergence, and retention alone changes no key, field, or score, so a mixed Sidekiq/Wurk fleet still reads the same buckets. With it, the class-level Wurk::Metrics::Query.top_jobs/for_job cap moved from MAX_HOURS = 72 to MAX_HOURS = 720, and a minutes: window past 480 promotes onto the 10-minute buckets instead of raising — only a window past 43200 minutes raises WindowTooWide. The Sidekiq-compatible instance API (Sidekiq::Metrics::Query#top_jobs/#for_job) is unchanged: it still clamps silently at 480 minutes / 72 hours, exactly as upstream, and the parity oracle pins it. GET /api/metrics?minutes=… now serves the requested window out to 30 days and answers 400 past it (it used to clamp silently to 480 minutes), and the SPA requests the 7d/30d tabs as ?hours=168/?hours=720 with the response echoing both hours and minutes so the label matches the served period.
  • The demo's error reporting is opt-in and sanitized. Sentry turns on only when WURK_DEMO_REPORT_ERRORS=1 and SENTRY_DSN are both set; with either one missing the demo never loads the SDK, never initialises Sentry and never installs Wurk::Sentry, so Wurk's server middleware and error handlers stay exactly as they were. Events from the demo's two deliberately-failing jobs (BrokenJob, FlakyWebhookJob) and soak-tagged events are dropped, and request headers, cookies and job arguments are scrubbed of credential- and personal-data-shaped material before an event leaves the demo. The rules live in the demo app (demo/lib/demo_sentry_policy.rb), not in the gem: the gem ships the integration, the demo decides what it may send.

Fixed

  • The reaper's stop now bounds its sweep to the list it is already draining. Reaper#stop waits for a running sweep only up to its bounded join timeout, and a sweep that outlasts that bound is deliberately left alive to wind down — still tracked, so a restart cannot start a second sweep alongside it. That sweep now finishes the one private list it is already draining (those jobs are still put back on their queue for a live worker to pick up: at-least-once, so nothing is lost even though a job may run twice), starts no further list, and makes at most one more Redis round trip instead of walking the rest of the keyspace. A stopping worker therefore no longer keeps requeueing orphans or holding the reaper's sweep locks past its shutdown. The reaper's cadence and grace period are unchanged, and nothing on the wire moves: no Redis key, job-JSON field or score format changed.

  • Re-registering the auto-registered Wurk::Batch::ServerMiddleware no longer moves it inside Expiry and the Limiter. Adding the batch middleware to the server chain again — a configure_server block, a test helper, a later add — now keeps it outside Wurk::Middleware::Expiry, which skips an expired job, and outside Wurk::Limiter::ServerMiddleware, which reschedules an over-limit job. An expired job is therefore counted as its batch's success instead of stranding the batch: the batch's pending count drops, the batch can complete, and its :complete and :success callbacks fire rather than the batch staying open forever. An over-limit job is no longer booked as a batch failure for a job that never ran. A middleware class may now declare an outer_of anchor — the classes it must stay outside of — and Chain#add places it before the first of them that is registered, keeping the slot it already holds if it is already outside them; a class that declares no anchor keeps Sidekiq's documented append (spec §10.1), and prepend, insert_before, insert_after and remove still relocate middleware deliberately, as before. The default server chain order is unchanged, and nothing on the wire moves: no Redis key, job-JSON field or score format changed.

  • A promoted minutes: window no longer rounds up to whole hours. The class-level dashboard API (Wurk::Metrics::Query.top_jobs / for_job) promotes a minutes: window past 480 onto the 10-minute buckets, but computed the promoted window as ceil(minutes / 60) hours and read hours × 6 of them — so minutes: 490 served 9 hours (54 buckets) while /api/metrics echoed 490, and the top_jobs totals included up to 50 extra minutes of executions that fell outside the window the caller asked for. The promotion now counts 10-minute buckets directly (ceil(minutes / 10); 490 minutes is exactly 49), so the served data stays inside the echoed window up to the trailing partial bucket. Explicit hours: windows are unchanged.

  • The demo's error-reporting scrubber no longer passes a serialized cookie jar through untouched. scrub_request_field returned early for any header or cookie field that was not a Hash, so an event whose request carried its cookies as a String ("session=abc123" — the shape a raw request env or a reconstructed event arrives in) was sent with the session value intact. A populated field in any shape but a Hash now fails closed like the rest of the policy: a per-entry scrub has no entries to work on, so nothing inside such a field can be vouched for and the event is dropped rather than sent half-scrubbed. An empty one still passes — it holds nothing.

  • push_bulk no longer silently normalizes symbol-keyed option hashes. Sidekiq::Client#push has always raised ArgumentError on symbol keys (spec §31.1) but the bulk path stringified them and pushed, so {class: MyJob, args: [[1]]} quietly worked while the single-job push did not — two entry points, two answers on what a valid push is. push_bulk now rejects any Symbol key, whole or mixed with String keys, with ArgumentError before any Redis write, matching push exactly. String-keyed bulks are unchanged: perform_bulk, the ActiveJob adapter's bulk path and the API's bulk endpoint all hand push_bulk String keys.

  • The release lane now classifies a GitHub Release's state explicitly instead of guessing at it. The scheduled release-due checkup read a Release as gem-less when its author was developerz-ai[bot] OR it carried zero assets, so a sanctioned break-glass manual release — a developerz-ai[bot]-authored Release with the .gem attached — was reported as a defect and aborted the checkup before the diff window was computed. The trigger is now the asset count: zero assets is the gem-less marker (and the only state the release-deletion runbook applies to), while a Release that carries the .gem is a real release whoever authored it. The author is read for context only. When no Release can be read at all, the state is left unclassified rather than collapsed into one undifferentiated error — a release.yml preflight no-op (the version is already on RubyGems), a break-glass publication, and a failure before the Release was created all stay open until the RubyGems per-version probe and the last release.yml run corroborate which one it was. RubyGems, not the absence of a Release, is the authority on publication.

  • A zero-asset GitHub Release no longer counts as proof that no gem shipped. release.yml pushes the gem before it creates the Release and uploads the .gem asset, so a succeeded push whose asset upload failed leaves zero assets on a version RubyGems has already burned. The release-due brief's gem-less diagnostic and prose now require the RubyGems per-version probe to confirm non-publication before the release-deletion runbook is named — the precondition the "Release states" table already put on the zero-asset row.

  • The Wurk::Queue pause/unpause docs no longer promise an unconditional true. The "Pausing a queue" section of docs/api.md claimed that both calls "return true whether or not they changed anything", but Wurk::Queue#pause! and #unpause! return true only when the call changed the queue's paused state — pause! when it added the queue to the paused SET, unpause! when it removed it — and false when there was no transition. That is the Sidekiq Pro behaviour, and it is what the method table in the same file already described. Documentation-only: no runtime behaviour changed, and the return values are still the SADD/SREM state-change booleans the unit and parity suites assert.

  • The migration guide's b-<bid>* compatibility row no longer promises unqualified Pro batch-schema compatibility. The b-<bid>*, batches row in §4 of docs/migrate-from-sidekiq.md read "✅ Pro batch schema", contradicting the guide's own §9 cutover warning: Wurk's b-<bid>-success/b-<bid>-complete markers mean "already fired" (callbacks enqueued, not necessarily executed), while Sidekiq Pro §2.8 describes the same keys as "callbacks pending", so a Pro batch in flight at the swap may miss its callbacks. The row now names that limitation and points at the §9 cutover warning, and §4's prose says the same in its own words. Documentation-only: no runtime behaviour changed.

  • The Pro §3.2 spec no longer says the processes membership SET expires. The bullet read "Process death: heartbeat key processes expires after 60s", but processes is a TTL-less membership SET: the 60s TTL belongs to the per-identity heartbeat hash <identity>, and liveness is judged by existence — an identity is alive only while its heartbeat hash still exists, so a SET member whose hash has expired is dead even though it is still listed. docs/target/sidekiq-pro.md now says so, and every place that repeated the claim was aligned to match it: the operator doc (docs/reliability.md), the HTTP API doc (docs/api-http.md), the reaper's liveness comment (lib/wurk/fetcher/reaper.rb), the launcher's heartbeat comment (lib/wurk/launcher.rb) and the launcher test's comment (test/unit/launcher_test.rb). Documentation-only: no runtime behaviour changed.

  • The reaper's unparseable-key warning now states its scope. The WARN a worker logs for a queue:*|* key that is not a private list it can read the owner of — a list whose owner tail does not parse, queue:<queue>|<host>|not-a-pid|<index>, say — said what to do about the list, but not how often the warning repeats, and the dedup behind it is not what an operator would assume: the already-reported keys are an in-memory Set held by the reaper, one instance per worker process and built after the fork, so there is no Redis key, no TTL, and nothing shared with the other workers. The message now ends with "Reported once per process: every worker that sees the key logs it for itself, and it is reported again after a restart.", and the reliability page and the incident runbook describe the repetition it implies: one identical line per booting worker pid (the boot sweep is unguarded), the same key reported again by a later sweep's lock winner only when that process has not reported it yet (each process's own set is the only memory), or after any restart, and the cluster-wide sweep lock deciding who sweeps, not who has already reported the key. No fleet-wide deduplication and no Redis key were added, and nothing changed beyond the message — the same keys are reported, by the same processes, at the same times.