GEARMAN_STRERROR(3)

✨ GEARMAN_STRERROR ✨

okay bestie, gather round 🫢 this is the Gearmand manual, section 3 β€” you know, the library-call girlies. It's literally your cheat sheet for every single way a gearman_return_t can come back at you, and how to turn those numbers into actual words with gearman_strerror. No cap, this one is a whole mood board of errors πŸ’…


🌸 SYNOPSIS 🌸

#include <libgearman/gearman.h>

type gearman_return_t

const char *gearman_strerror(gearman_return_t rc)

bool gearman_success(gearman_return_t rc)

bool gearman_failed(gearman_return_t rc)

bool gearman_continue(gearman_return_t rc)

and like, compile and link with -lgearman or it's not gonna know what you're talking abt πŸ’€


πŸ’– DESCRIPTION πŸ’–

So gearman_return_t is the return/error type for literally every call that touches gearman_client_st or gearman_worker_st. Like, every single one. If things went great you get GEARMAN_SUCCESS, and if they did not, you get an error instead. That's it, that's the vibe.

Want to know if your return value is a sad one? gearman_failed() has you. Want the actual human-readable text version of the error so you can print it and stare at it? gearman_strerror() is your girl ✨

  • gearman_success() β†’ returns true if it's GEARMAN_SUCCESS, or if GEARMAN_NO_PENDING_TASKS tests true. (yep, both count as a win πŸ’–)
  • gearman_failed() β†’ returns true if literally any value other than GEARMAN_SUCCESS was provided.
  • gearman_continue() β†’ returns true if any error related to non-blocking IO occurred. Bestie, this one is for testing loops. Use it there.

🌈 Possible values of gearman_return_t: 🌈

  • type GEARMAN_SUCCESS β€” Success πŸŽ‰ iconic, perfect, no notes.
  • type GEARMAN_NO_PENDING_TASKS β€” gearman_client_run_tasks() was called and it has completed all tasks assigned to the client. all done, queen πŸ‘‘
  • type GEARMAN_IO_WAIT β€” Blocking IO was found. gearman_continue() can be used to test for this.
  • type GEARMAN_ERRNO β€” System error occurred. Use either gearman_client_errno() or gearman_worker_errno().
  • type GEARMAN_NO_ACTIVE_FDS β€” No active connections were available. gearman_continue() can be used to test for this.
  • type GEARMAN_GETADDRINFO β€” Name resolution failed for a host. 😭
  • type GEARMAN_NO_SERVERS β€” No servers have been provided for the client/worker.
  • type GEARMAN_LOST_CONNECTION β€” Connection was lost to the given server. πŸ’€ she ghosted you.
  • type GEARMAN_MEMORY_ALLOCATION_FAILURE β€” Memory allocation failed.
  • type GEARMAN_SERVER_ERROR β€” An error occurred on the server.
  • type GEARMAN_NOT_CONNECTED β€” Client/Worker is not currently connected to the server.
  • type GEARMAN_COULD_NOT_CONNECT β€” Server name was valid, but a connection could not be made.
  • type GEARMAN_ECHO_DATA_CORRUPTION β€” Either gearman_client_echo() or gearman_worker_echo() echo was unsuccessful because the data was returned from gearmand corrupted.
  • type GEARMAN_UNKNOWN_STATE β€” The gearman_return_t was never set. mystery era πŸ•΅οΈ
  • type GEARMAN_FLUSH_DATA β€” Internal state, should never be seen by either client or worker. (so if you see it… bestie.)
  • type GEARMAN_SEND_BUFFER_TOO_SMALL β€” Send buffer was too small.
  • type GEARMAN_TIMEOUT β€” A timeout occurred when making a request to the server.
  • type GEARMAN_ARGUMENT_TOO_LARGE β€” Argument was too large for the current buffer.
  • type GEARMAN_INVALID_ARGUMENT β€” One of the arguments to the given API call was invalid. EINVAL will be set if gearman_client_error() or gearman_worker_error() were not settable. This can also be returned if GEARMAN_CLIENT_UNBUFFERED_RESULT was set, but the client is not handling the data correctly.

πŸŽ€ CLIENT ONLY πŸŽ€

  • type GEARMAN_NEED_WORKLOAD_FN β€” A client was asked for work, but no gearman_workload_fn callback was specified. See gearman_client_set_workload_fn().
  • type GEARMAN_WORK_FAIL β€” A task has failed, and the worker has exited with an error or it called gearman_job_send_fail().
  • type GEARMAN_IN_PROGRESS β€” gearman_client_job_status() has been called for a gearman_job_handle_t and the Job is currently being run by a worker.
  • type GEARMAN_JOB_EXISTS β€” gearman_client_job_status() has been called for a gearman_job_handle_t and the Job is currently known by a server, but is not being run by a worker.

πŸ¦‹ WORKER ONLY πŸ¦‹

  • type GEARMAN_INVALID_FUNCTION_NAME β€” A worker was sent a request for a job that it did not have a valid function for.
  • type GEARMAN_INVALID_WORKER_FUNCTION β€” No callback was provided by the worker for a given function.
  • type GEARMAN_NO_REGISTERED_FUNCTION β€” A request for removing a given function from a worker was invalid since that function did not exist.
  • type GEARMAN_NO_REGISTERED_FUNCTIONS β€” The worker has not registered any functions.
  • type GEARMAN_NO_JOBS β€” No jobs were found for the worker. This error code is only returned if the worker has just made a request for jobs.

πŸ’… WORKER TO CLIENT πŸ’…

Clients which have registered a custom gearman_actions_t may use these values as return values to the calling client.

  • type GEARMAN_WORK_DATA β€” Worker has sent a chunked piece of data to the client via gearman_job_send_data().
  • type GEARMAN_WORK_WARNING β€” Worker has issued a warning to the client via gearman_job_send_warning().
  • type GEARMAN_WORK_STATUS β€” Status has been updated by the worker via gearman_job_send_status().
  • type GEARMAN_WORK_EXCEPTION β€” Worker has sent an exception to the client via gearman_job_send_exception().
  • type GEARMAN_WORK_FAIL β€” A task has failed, and the worker has exited with an error or it called gearman_job_send_fail().
  • type GEARMAN_WORK_ERROR β€” A task has had an error and will be retried.
  • type GEARMAN_PAUSE β€” Used only in custom application for client return based on GEARMAN_WORK_DATA, GEARMAN_WORK_WARNING, GEARMAN_WORK_EXCEPTION, GEARMAN_WORK_FAIL, or GEARMAN_WORK_STATUS. gearman_continue() can be used to check for this value.

πŸ“ WORKER TO CLIENT (yes, again, same heading as the one above β€” the original really said it twice, and I'm keeping it that way, periodt) πŸ“

Any function defined by gearman_worker_define_function() may, and can only, return the following gearman_return_t values:

  • type GEARMAN_SUCCESS β€” The function successfully completed the job. slay ✨
  • type GEARMAN_FATAL
  • type GEARMAN_FAIL β€” The function failed to complete the job. GEARMAN_FATAL is the deprecated name for GEARMAN_FAIL.
  • type GEARMAN_ERROR β€” A task has had an error and will be retried.
  • type GEARMAN_SHUTDOWN β€” GEARMAN_SHUTDOWN is a special case. If it is returned the client will be sent GEARMAN_SUCCESS, but gearman_worker_work() will exit with GEARMAN_SHUTDOWN.

⭐ TASK ONLY ⭐

  • type GEARMAN_NOT_FLUSHING β€” gearman_task_send_workload() failed, it was not in the correct state.
  • type GEARMAN_DATA_TOO_LARGE β€” gearman_task_send_workload() failed, the data was too large to be sent.
  • type GEARMAN_UNKNOWN_OPTION β€” Default state of task return value.

🚨 PROTOCOL 🚨

If any of these errors occurred the connection will be dropped/reset. Like, the whole thing. gone. πŸ’€
  • type GEARMAN_INVALID_MAGIC
  • type GEARMAN_INVALID_COMMAND
  • type GEARMAN_INVALID_PACKET
  • type GEARMAN_UNEXPECTED_PACKET
  • type GEARMAN_TOO_MANY_ARGS

πŸ™ˆ DEPRECATED πŸ™ˆ

(these are giving old-money legacy code β€” leave them alone bestie)

  • type GEARMAN_IGNORE_PACKET
  • type GEARMAN_MAX_RETURN

πŸ”₯ SEE ALSO πŸ”₯

gearmand(8) libgearman(3) gearman_client_error() or gearman_worker_error()


πŸ’œ Author πŸ’œ

Data Differential http://www.datadifferential.com/

2011-2014, Data Differential, http://www.datadifferential.com/


k that's the whole thing, bestie, you ate 🫢 sending you off with the receipts: this is version 1.1.21+ds, dated Feb 04, 2026, straight from the Gearmand crew β€” mwah, go write some slay error handling πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from