github ptrofimov/beanstalk_console 1.9.0

5 hours ago

Added review batches for safer Beanstalkd job inspection and actions

Summary

This release adds a feature-gated review batch workflow for inspecting a bounded set of jobs from a tube before deciding what to do with them. A review batch copies jobs into an isolated review tube, deletes the original only after the review copy exists, and records an audit/current-state manifest on disk.

From the review UI, jobs can then be moved back to the source tube, moved elsewhere, duplicated, or deleted.

The feature is disabled by default through config and is intended for operators who currently pause a tube, move jobs aside manually, inspect them, and then move/delete them.

Main Changes

  • Add review batch actions and UI.
  • Let the user choose source state (buried, delayed, ready) and count of jobs to review.
  • Copy source jobs into a generated review tube.
  • Remove original jobs from the source state only after the review copy has been created.
  • Check ready/delayed review safety using watcher/waiter counts and tube pause state.
  • Offer "Pause tube and proceed" when pausing makes review safe.
  • Allow buried review directly because workers cannot reserve buried jobs.
  • Use a destination tube field, prefilled with the source tube, for move/duplicate actions.
  • Suggest existing tubes in the destination field while still allowing a new tube name.
  • Support selected-job and all-undecided-job move, duplicate, and delete operations.
  • Keep duplicated review copies actionable until the user moves or deletes them.
  • Store append-only JSONL audit logs.
  • Store a materialized current-state JSON file for efficient listing, review page, count, and moved-job lookups.
  • Optionally store body snapshots with an index sidecar for display/export.
  • Add another-session warnings and safe takeover for abandoned review batches.
  • Add focused tests for naming, service operations, page data building, and storage current-state behavior.

Safety Model

The source job is copied into the review tube first. The original source job is deleted only after the review copy is created. If copying succeeds but source deletion fails, the review copy is kept visible with a cleanup/error status so the operator can still inspect and handle it.

Ready and delayed jobs can be reserved by workers, so review prep checks stats-tube watcher/waiter counts and pause state. Review can proceed when no clients are watching/waiting, or when the source tube is paused. Buried jobs can proceed directly because buried jobs are not reservable by workers.

Why This Uses A Review Tube

The review copy remains inside beanstalkd. The JSONL files live on the console server and are used for audit, summaries, body display, and exports. They are not intended to be the only recovery copy of the jobs.

Using a review tube preserves queue-native semantics:

  • the review job remains a beanstalkd job
  • workers no longer see it in the source tube
  • move/duplicate/delete actions operate against a queue-side copy
  • partial failures can leave a visible review copy to clean up

Review batch files are console-local support files used for auditing, current-state tracking, exports, and optional body display. They are not automatically removed over time, but deleting a review batch from the UI removes its batch files.

Configuration

The feature is disabled by default and can be opted in to by setting $GLOBALS['config']['review'] = true; in config.local.php:

'review' => array(
    'enabled' => false,
    'chunkSize' => 200,
    'bodyPreviewLength' => 100,
    'allowReadyWhenUnwatched' => true,
    'allowDelayedWhenUnwatched' => true,
    'allowUnsafeReadyOverride' => false,
    'allowUnsafeDelayedOverride' => false,
    'neverIncludeBodySnapshot' => false,
    'storagePath' => null,
),

neverIncludeBodySnapshot hides the body-snapshot checkbox and prevents body snapshot files from being created for new batches. In that mode the review UI still works, but bodies are loaded from live review-copy jobs and may no longer be available after those review copies are moved/deleted.

Notes And Tradeoffs

  • The feature is intentionally opt-in via config.
  • The review batch workflow keeps actionable review copies in Beanstalkd, while console-local files store the batch bookkeeping: audit history, current status, original job metadata, and optional body snapshots. The JSONL files support the review workflow but are not a replacement queue.
  • Reviewed jobs receive new beanstalkd job ids when they are copied into the review tube and again when moved or duplicated to a destination tube. The review files keep the original, review, returned, and target ids where relevant so operators can correlate the lifecycle.
  • Body snapshots are optional. Enabling them preserves review-time payloads and makes later body display more efficient by reading local snapshot data instead of peeking each review-copy job from the queue, but it can create large local files.
  • Review batch files are not automatically removed over time, but deleting a review batch from the UI removes its batch files. Completed batches should be deleted or body snapshots disabled if disk growth is a concern.

Don't miss a new beanstalk_console release

NewReleases is sending notifications on new releases.