16 KiB
Changelog
All notable changes to this project will be documented in this file.
The format is based on "Keep a Changelog", and this project adheres to Semantic Versioning.
[Unreleased]
Added
- Enable rediss url parsing support
[0.22.1] - 2022-02-20
Fixed
- Fixed Redis version compatibility: Keep support for redis v4.0+
[0.22.0] - 2022-02-19
Added
BaseContextis introduced inConfigto specify callback hook to provide a basecontextfrom whichHandlercontextis derivedIsOrphanedfield is added toTaskInfoto describe a task left in active state with no worker processing it.
Changed
Servernow recovers tasks with an expired lease. Recovered tasks are retried/archived withErrLeaseExpirederror.
[0.21.0] - 2022-01-22
Added
PeriodicTaskManageris added. Prefer using this overScheduleras it has better support for dynamic periodic tasks.- The
asynq statscommand now supports a--jsonoption, making its output a JSON object - Introduced new configuration for
DelayedTaskCheckInterval. See godoc for more details.
[0.20.0] - 2021-12-19
Added
- Package
x/metricsis added. - Tool
tools/metrics_exporterbinary is added. ProcessedTotalandFailedTotalfields were added toQueueInfostruct.
[0.19.1] - 2021-12-12
Added
Latencyfield is added toQueueInfo.EnqueueContextmethod is added toClient.
Fixed
- Fixed an error when user pass a duration less than 1s to
Uniqueoption
[0.19.0] - 2021-11-06
Changed
NewTasktakesOptionas variadic argument- Bumped minimum supported go version to 1.14 (i.e. go1.14 or higher is required).
Added
Retentionoption is added to allow user to specify task retention duration after completion.TaskIDoption is added to allow user to specify task ID.ErrTaskIDConflictsentinel error value is added.ResultWritertype is added and provided throughTask.ResultWritermethod.TaskInfohas new fieldsCompletedAt,ResultandRetention.
Removed
Client.SetDefaultOptionsis removed. UseNewTaskinstead to pass default options for tasks.
[0.18.6] - 2021-10-03
Changed
- Updated
github.com/go-redis/redispackage to v8
[0.18.5] - 2021-09-01
Added
IsFailureconfig option is added to determine whether error returned from Handler counts as a failure.
[0.18.4] - 2021-08-17
Fixed
- Scheduler methods are now thread-safe. It's now safe to call
RegisterandUnregisterconcurrently.
[0.18.3] - 2021-08-09
Changed
Client.Enqueueno longer enqueues tasks with empty typename; Error message is returned.
[0.18.2] - 2021-07-15
Changed
- Changed
Queuefunction to not to convert the provided queue name to lowercase. Queue names are now case-sensitive. QueueInfo.MemoryUsageis now an approximate usage value.
Fixed
- Fixed latency issue around memory usage (see https://github.com/hibiken/asynq/issues/309).
[0.18.1] - 2021-07-04
Changed
- Changed to execute task recovering logic when server starts up; Previously it needed to wait for a minute for task recovering logic to exeucte.
Fixed
- Fixed task recovering logic to execute every minute
[0.18.0] - 2021-06-29
Changed
- NewTask function now takes array of bytes as payload.
- Task
TypeandPayloadshould be accessed by a method call. ServerAPI has changed. RenamedQuiettoStop. RenamedStoptoShutdown. Note: As a result of this renaming, the behavior ofStophas changed. Please update the exising code to callShutdownwhere it used to callStop.SchedulerAPI has changed. RenamedStoptoShutdown.- Requires redis v4.0+ for multiple field/value pair support
Client.Enqueuenow returnsTaskInfoInspector.RunTaskByKeyis replaced withInspector.RunTaskInspector.DeleteTaskByKeyis replaced withInspector.DeleteTaskInspector.ArchiveTaskByKeyis replaced withInspector.ArchiveTaskinspeqpackage is removed. All types and functions from the package is moved toasynqpackage.WorkerInfofield names have changed.Inspector.CancelActiveTaskis renamed toInspector.CancelProcessing
[0.17.2] - 2021-06-06
Fixed
- Free unique lock when task is deleted (https://github.com/hibiken/asynq/issues/275).
[0.17.1] - 2021-04-04
Fixed
- Fix bug in internal
RDB.memoryUsagemethod.
[0.17.0] - 2021-03-24
Added
DialTimeout,ReadTimeout, andWriteTimeoutoptions are added toRedisConnOpt.
[0.16.1] - 2021-03-20
Fixed
- Replace
KEYScommand withSCANas recommended by redis doc.
[0.16.0] - 2021-03-10
Added
Unregistermethod is added toSchedulerto remove a registered entry.
[0.15.0] - 2021-01-31
IMPORTATNT: All Inspector related code are moved to subpackage "github.com/hibiken/asynq/inspeq"
Changed
Inspectorrelated code are moved to subpackage "github.com/hibken/asynq/inspeq".RedisConnOptinterface has changed slightly. If you have been passingRedisClientOpt,RedisFailoverClientOpt, orRedisClusterClientOptas a pointer, update your code to pass as a value.ErrorMsgfield inRetryTaskandArchivedTaskwas renamed toLastError.
Added
MaxRetry,Retried,LastErrorfields were added to all task types returned fromInspector.MemoryUsagefield was added toQueueStats.DeleteAllPendingTasks,ArchiveAllPendingTaskswere added toInspectorDeleteTaskByKeyandArchiveTaskByKeynow supports deleting/archivingPendingTask.- asynq CLI now supports deleting/archiving pending tasks.
[0.14.1] - 2021-01-19
Fixed
go.modfile for CLI
[0.14.0] - 2021-01-14
IMPORTATNT: Please run asynq migrate command to migrate from the previous versions.
Changed
- Renamed
DeadTasktoArchivedTask. - Renamed the operation
KilltoArchiveinInpsector. - Print stack trace when Handler panics.
- Include a file name and a line number in the error message when recovering from a panic.
Added
DefaultRetryDelayFuncis now a public API, which can be used in the customRetryDelayFunc.SkipRetryerror is added to be used as a return value fromHandler.Serversmethod is added toInspectorCancelActiveTaskmethod is added toInspector.ListSchedulerEnqueueEventsmethod is added toInspector.SchedulerEntriesmethod is added toInspector.DeleteQueuemethod is added toInspector.
[0.13.1] - 2020-11-22
Fixed
- Fixed processor to wait for specified time duration before forcefully shutdown workers.
[0.13.0] - 2020-10-13
Added
Schedulertype is added to enable periodic tasks. See the godoc for its APIs and wiki for the getting-started guide.
Changed
- interface
Optionhas changed. See the godoc for the new interface. This change would have no impact as long as you are using exported functions (e.g.MaxRetry,Queue, etc) to createOptions.
Added
Payload.String() stringmethod is addedPayload.MarshalJSON() ([]byte, error)method is added
[0.12.0] - 2020-09-12
IMPORTANT: If you are upgrading from a previous version, please install the latest version of the CLI go get -u github.com/hibiken/asynq/tools/asynq and run asynq migrate command. No process should be writing to Redis while you run the migration command.
The semantics of queue have changed
Previously, we called tasks that are ready to be processed "Enqueued tasks", and other tasks that are scheduled to be processed in the future "Scheduled tasks", etc. We changed the semantics of "Enqueue" slightly; All tasks that client pushes to Redis are Enqueued to a queue. Within a queue, tasks will transition from one state to another. Possible task states are:
Pending: task is ready to be processed (previously called "Enqueued")Active: tasks is currently being processed (previously called "InProgress")Scheduled: task is scheduled to be processed in the futureRetry: task failed to be processed and will be retried again in the futureDead: task has exhausted all of its retries and stored for manual inspection purpose
These semantics change is reflected in the new Inspector API and CLI commands.
Changed
Client
Use ProcessIn or ProcessAt option to schedule a task instead of EnqueueIn or EnqueueAt.
| Previously | v0.12.0 |
|---|---|
client.EnqueueAt(t, task) |
client.Enqueue(task, asynq.ProcessAt(t)) |
client.EnqueueIn(d, task) |
client.Enqueue(task, asynq.ProcessIn(d)) |
Inspector
All Inspector methods are scoped to a queue, and the methods take qname (string) as the first argument.
EnqueuedTask is renamed to PendingTask and its corresponding methods.
InProgressTask is renamed to ActiveTask and its corresponding methods.
Command "Enqueue" is replaced by the verb "Run" (e.g. EnqueueAllScheduledTasks --> RunAllScheduledTasks)
CLI
CLI commands are restructured to use subcommands. Commands are organized into a few management commands:
To view details on any command, use asynq help <command> <subcommand>.
asynq statsasynq queue [ls inspect history rm pause unpause]asynq task [ls cancel delete kill run delete-all kill-all run-all]asynq server [ls]
Added
RedisConnOpt
RedisClusterClientOptis added to connect to Redis Cluster.Usernamefield is added to allRedisConnOpttypes in order to authenticate connection when Redis ACLs are used.
Client
ProcessIn(d time.Duration) OptionandProcessAt(t time.Time) Optionare added to replaceEnqueueInandEnqueueAtfunctionality.
Inspector
Queues() ([]string, error)method is added to get all queue names.ClusterKeySlot(qname string) (int64, error)method is added to get queue's hash slot in Redis cluster.ClusterNodes(qname string) ([]ClusterNode, error)method is added to get a list of Redis cluster nodes for the given queue.Close() errormethod is added to close connection with redis.
Handler
GetQueueName(ctx context.Context) (string, bool)helper is added to extract queue name from a context.
[0.11.0] - 2020-07-28
Added
Inspectortype was added to monitor and mutate state of queues and tasks.HealthCheckFuncandHealthCheckIntervalfields were added toConfigto allow user to specify a callback function to check for broker connection.
[0.10.0] - 2020-07-06
Changed
- All tasks now requires timeout or deadline. By default, timeout is set to 30 mins.
- Tasks that exceed its deadline are automatically retried.
- Encoding schema for task message has changed. Please install the latest CLI and run
migratecommand if you have tasks enqueued with the previous version of asynq. - API of
(*Client).Enqueue,(*Client).EnqueueIn, and(*Client).EnqueueAthas changed to return a*Result. - API of
ErrorHandlerhas changed. It now takes context as the first argument and removedretried,maxRetryfrom the argument list. UseGetRetryCountand/orGetMaxRetryto get the count values.
[0.9.4] - 2020-06-13
Fixed
- Fixes issue of same tasks processed by more than one worker (https://github.com/hibiken/asynq/issues/90).
[0.9.3] - 2020-06-12
Fixed
- Fixes the JSON number overflow issue (https://github.com/hibiken/asynq/issues/166).
[0.9.2] - 2020-06-08
Added
- The
pauseandunpausecommands were added to the CLI. See README for the CLI for details.
[0.9.1] - 2020-05-29
Added
GetTaskID,GetRetryCount, andGetMaxRetryfunctions were added to extract task metadata from context.
[0.9.0] - 2020-05-16
Changed
Loggerinterface has changed. Please see the godoc for the new interface.
Added
LogLeveltype is added. Server's log level can be specified throughLogLevelfield inConfig.
[0.8.3] - 2020-05-08
Added
Closemethod is added toClient.
[0.8.2] - 2020-05-03
Fixed
[0.8.1] - 2020-04-27
Added
ParseRedisURIhelper function is added to create aRedisConnOptfrom a URI string.SetDefaultOptionsmethod is added toClient.
[0.8.0] - 2020-04-19
Changed
Backgroundtype is renamed toServer.- To upgrade from the previous version, Update
NewBackgroundtoNewServerand passConfigby value. - CLI is renamed to
asynq. - To upgrade the CLI to the latest version run
go get -u github.com/hibiken/tools/asynq - The
pscommand in CLI is renamed toservers Concurrencydefaults to the number of CPUs when unset or set to a negative value.
Added
ShutdownTimeoutfield is added toConfigto speicfy timeout duration used during graceful shutdown.- New
Servertype exposesStart,Stop, andQuietas well asRun.
[0.7.1] - 2020-04-05
Fixed
- Fixed signal handling for windows.
[0.7.0] - 2020-03-22
Changed
- Support Go v1.13+, dropped support for go v1.12
Added
Uniqueoption was added to allow client to enqueue a task only if it's unique within a certain time period.
[0.6.2] - 2020-03-15
Added
Usemethod was added toServeMuxto apply middlewares to all handlers.
[0.6.1] - 2020-03-12
Added
Clientcan optionally schedule task withasynq.Deadline(time)to specify deadline for task's context. Default is no deadline.Loggeroption was added to config, which allows user to specify the logger used by the background instance.
[0.6.0] - 2020-03-01
Added
- Added
ServeMuxtype to make it easy for users to implement Handler interface. ErrorHandlertype was added. Allow users to specify error handling function (e.g. Report error to error reporting service such as Honeybadger, Bugsnag, etc)
[0.5.0] - 2020-02-23
Changed
ClientAPI has changed. UseEnqueue,EnqueueAtandEnqueueInto enqueue and schedule tasks.
Added
asynqmon workerswas added to list all running workers information
[0.4.0] - 2020-02-13
Changed
Handlerinterface has changed.ProcessTaskmethod takes two argumentscontext.Contextand*asynq.TaskQueuesfield inConfighas change frommap[string]uinttomap[string]int
Added
Clientcan optionally schedule task withasynq.Timeout(duration)to specify timeout duration for task. Default is no timeout.asynqmon cancel [task id]will send a cancelation signal to the goroutine processing the speicified task.
[0.3.0] - 2020-02-04
Added
asynqmon pswas added to list all background worker processes
[0.2.2] - 2020-01-26
Fixed
- Fixed restoring unfinished tasks back to correct queues.
Changed
asynqmon lscommand is now paginated (default 30 tasks from first page)asynqmon ls enqueued:[queue name]requires queue name to be specified
[0.2.1] - 2020-01-22
Fixed
- More structured log messages
- Prevent spamming logs with a bunch of errors when Redis connection is lost
- Fixed and updated README doc
[0.2.0] - 2020-01-19
Added
- NewTask constructor
Queuesoption inConfigto specify mutiple queues with priority levelClientcan schedule a task withasynq.Queue(name)to specify which queue to useStrictPriorityoption inConfigto specify whether the priority should be followed strictlyRedisConnOptto abstract away redis client implementation- [CLI]
asynqmon rmqcommand to remove queue
Changed
ClientandBackgroundconstructors takeRedisConnOptas their first argument.asynqmon statsnow shows the total of all enqueued tasks under "Enqueued"asynqmon statsnow shows each queue's task countasynqmon historynow doesn't take any arguments and shows data from the last 10 days by default (use--daysflag to change the number of days)- Task type is now immutable (i.e., Payload is read-only)
[0.1.0] - 2020-01-04
Added
- Initial version of asynq package
- Initial version of asynqmon CLI