Repository navigation
Added
- The web UI's Streams page shows when each stream last received a message
limit: { duration:, retry_in: }accept duration strings such as"82m", not only secondsJob.perform_bulk(list)enqueues one job per argument list, pipelining the publishes a thousand at a timeJob.set(stream:, retry:, dead:, subject:)overrides job options for a singleperform_async/perform_in/perform_atconsumers.jobsincosmo.ymlcan be a list of groups, flattened on load, to organize consumers by worker fleetsetup.cronincosmo.ymlcan be a list of groups to organize cron schedules
Changed
-
Breaking: running jobs live in a new
_cosmojobsbucket, written by each worker's 10s heartbeat, instead of one
_cosmobusywrite per job.Middleware::BusyandAPI::Stats::Busyare gone (dropchain.remove Cosmo::Middleware::Busy),
and_cosmoprocesseskeys are now<kind>.<host>.<pid>.<concurrency>. After a rollout,nats kv del _cosmobusy -f -
The Web UI counts running jobs and processes on the server and reads only the page it shows, instead of watching whole
buckets on every poll. "Running now" became a "Running sample", and the Busy tab has an "Order by longest" button -
The sidebar's batch badge counts up to 100 batches by direct get and shows "100+" past that
-
A worker whose shutdown times out releases the messages it's still processing before it exits instead of leaving
them forack_wait: a job counts as a failed attempt withCosmo::JobInterruptedError, retried after its usual
delay or moved todeadwithout attempts left; stream messages are NAK'd and redelivered after 10s
(COSMO_STREAMS_RELEASE_DELAY). The interrupted threads are then killed and get up to 5s to unwind while NATS is
still connected, so a worker exits right after its shutdown timeout instead of waiting out a JetStream request
timeout per busy job, and their running-job entries are cleared -
Breaking:
config.replicasisconfig.services.num_replicas, named like thenum_replicaseach stream in
cosmo.ymlsets for itself; it only sizes Cosmo's own streams and buckets -
API::Counter#increment/#incrand#decrement/#decrlog a counter that can't be written and return nil;
#increment!/#incr!and#decrement!/#decr!raise as they used to -
A job worker skips a configured stream that doesn't exist in NATS with a warning, instead of crashing on boot
-
Breaking: Ruby 3.2 or newer is required, Ruby 3.1 is no longer supported
Fixed
- The Web UI's
?limit=is kept between 1 and 100:0raised, and over 1024 read an empty page - A job's
limit: { duration: }can't be swallowed by job code rescuingTimeout::ErrororStandardError
anymore; it fails withCosmo::JobTimeoutError, so the dead stream tells it apart from aTimeout::Errorraised by
the job's own code - A job whose class a worker can't load, e.g. mid-deploy, runs through the server middleware with a
niljob and
fails withCosmo::JobClassNotFoundError, so it is counted and retried as its payload'sretryallows instead of
going straight todead; a malformed payload still goes straight todeadbut counts as failed - A cron job takes
retryanddeadfrom its job class instead of always the defaults - Metrics read a period by start time instead of a
multi_lastget capped at 1024 subjects - Web UI buttons show a pointer cursor and a fill on hover