gearmand 2.1.0 is a feature and bug fix release that brings significant improvements to thread safety and connection lifecycle reliability, improved OpenSSL error diagnostics, a new --ping option for server health checks, and fixes and improvements to persistent storage plugins (notably, Redis and MySQL).
While this isn't as big of a release as 2.0.0, this is still a very important release, and upgrading is highly recommended, as this release should greatly improve reliability of the server in a long-running environment.
Notable Behavior Change
--job-retries=0now means zero retries (PR #500 by @p-alik) –--job-retries=0previously meant to retry jobs infinitely. This was very non-intuitive, obviously. It now means zero retries (drop job after the first failure). The default value is now-1(for unlimited retries), preserving the previous default behavior when--job-retriesis omitted.
Major New Features / Improvements
- Added
--pingoption to gearman client (PR #508 by @esabol) – Introduces--pingcommand-line option for server connectivity and health check testing (PR #508 by @esabol with revisions by @p-alik, addresses issue #315). - Refuse
--sslstartup on non-SSL binaries (PR #499 by @p-alik) – Passing--sslto a gearmand binary compiled without SSL support now logs a fatal error and aborts startup instead of silently falling back to unencrypted connections (PR #499 by @p-alik, fixes issue #207). - Transparent Redis reconnection on connection loss (PR #489 by @p-alik) – The Redis persistent storage plugin will transparently reconnect to the Redis queue backend (with rate-limiting and re-authentication) if the connection is dropped (PR #489 by @p-alik, fixes issue #45).
- Non-blocking Redis queue replay using
SCAN(PR #487 by @p-alik) – Replaced the blockingKEYScommand with cursor-basedSCANduring queue replay on startup (PR #487 by @p-alik, fixes issue #59). - Redis storage support for hyphenated function names (PR #497 by @p-alik) – Function name and unique ID are now stored as dedicated hash fields in Redis (
HMSET), preventing function names containing hyphens from being misparsed during replay (PR #497 by @p-alik, fixes issue #159).
Notable Bug Fixes
- Multiple data race issues resolved when using multiple threads (PRs #482, #493, #494, #495, #496, and #501 by @p-alik) – Resolved TSAN-identified data races across connection lifecycle code (fixes issue #460). Made
is_dead,io_list,proc_list,proc_removed,to_be_freed_list,dcon_add_count, andcon->retatomic, moved pre-checks inside critical sections, and ensured consistent locking ingearmand_con_create(). - Fixed OpenSSL error string decoding by querying
ERR_get_error()instead of rawSSL_get_error()enums, eliminating misleading error messages like "DH lib" (PR #484 by @p-alik, fixes issue #28). - Fixed double-free and object reuse hazard in
gearmand_con_free()by clearingdcon->server_conon_con_add()failure (PR #485 by @p-alik, fixes issue #29). - Bounded MySQL queue retry on
CR_SERVER_LOSTto a single attempt, preventing infinite loops and server hangs when processing oversized packets (PR #498 by @p-alik, fixes issue #126). - Prevented process
abort()on recoverable SSL initialization errors inctx_ssl(), returningNULLand propagatingGEARMAN_INVALID_ARGUMENTcleanly (PR #504 by @p-alik, fixes issue #503). - Reported explicit error when an SSL connection is requested using a
gearmanclient compiled without SSL support (PR #508 by @esabol).
Build / CI / Maintenance
- Improve detection of modern C++ standards and prioritize the usage of newer standards when building, e.g.
-std=c++14(PR #507 by @esabol). Homebrew recipe updaters, please take note. - Cleaned up unused byte-order code by removing
libgearman/byteorder.{cc,h}and thehtonllandendian.hconfigure checks (PR #508 by @esabol with input from @p-alik). Homebrew recipe updaters, please take note. - Made
libhostileand YATL random seeds overridable viaHOSTILE_SEEDandYATL_RANDOM_SEEDenvironment variables, ensuring seeds are always logged for test reproducibility (PR #483 by @p-alik, fixes issue #24). - Added explicit SSL connectivity test
t/ssltomake test(PR #486 by @p-alik, fixes issue #56). - The path to the Redis server can now be specified with
--with-redis-server=[PATH](PR #491 by @p-alik). - Enhanced Redis queue test coverage by spawning a real
redis-serverprocess int/redisand adding a Redis build job to GitHub Actions CI (PR #491 by @p-alik, fixes issue #490). - Updated Dependabot configuration to ignore minor and patchlevel dependency version updates (PR #492 by @esabol).
- Fixed GCC 4.4 build failure caused by variable-length array initialization of
argvlenin Redisqueue.cc(PR #497 by @p-alik, fixes issue #113). - Added MySQL server startup support to
libtestand enabled thet/mysqltest suite with regression testing (PR #498 by @p-alik). - Fixed Sphinx formatting warnings in
ssl.rstandindex.rst(@esabol). - Fixed
AX_PROG_SPHINX_BUILDautoconf m4 macro detection logic and temporary file handling (PR #509 by @esabol).
Contributors
Huge thanks to everyone who contributed to this release, notably:
- Alexei Pastuchov (@p-alik) -- comprehensive thread safety and connection lifecycle fixes (issue #460), improvements and fixes to multiple persistent storage plugins, OpenSSL error decoding and SSL error handling, test suite enhancements, and various other bug fixes
- Ed Sabol (@esabol) -- client
--pinghealth check option (PR #508), modern C++ standard detection, autoconf m4 macro fixes, build cleanup, documentation improvements, and Dependabot updates
Full Changelog: 2.0.0...2.1.0