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'sGEARMAN_SUCCESS, or ifGEARMAN_NO_PENDING_TASKStests true. (yep, both count as a win π)gearman_failed()β returns true if literally any value other thanGEARMAN_SUCCESSwas 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 eithergearman_client_errno()orgearman_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β Eithergearman_client_echo()orgearman_worker_echo()echo was unsuccessful because the data was returned from gearmand corrupted.type GEARMAN_UNKNOWN_STATEβ Thegearman_return_twas 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.EINVALwill be set ifgearman_client_error()orgearman_worker_error()were not settable. This can also be returned ifGEARMAN_CLIENT_UNBUFFERED_RESULTwas set, but the client is not handling the data correctly.
π CLIENT ONLY π
type GEARMAN_NEED_WORKLOAD_FNβ A client was asked for work, but nogearman_workload_fncallback was specified. Seegearman_client_set_workload_fn().type GEARMAN_WORK_FAILβ A task has failed, and the worker has exited with an error or it calledgearman_job_send_fail().type GEARMAN_IN_PROGRESSβgearman_client_job_status()has been called for agearman_job_handle_tand the Job is currently being run by a worker.type GEARMAN_JOB_EXISTSβgearman_client_job_status()has been called for agearman_job_handle_tand 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 viagearman_job_send_data().type GEARMAN_WORK_WARNINGβ Worker has issued a warning to the client viagearman_job_send_warning().type GEARMAN_WORK_STATUSβ Status has been updated by the worker viagearman_job_send_status().type GEARMAN_WORK_EXCEPTIONβ Worker has sent an exception to the client viagearman_job_send_exception().type GEARMAN_WORK_FAILβ A task has failed, and the worker has exited with an error or it calledgearman_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 onGEARMAN_WORK_DATA,GEARMAN_WORK_WARNING,GEARMAN_WORK_EXCEPTION,GEARMAN_WORK_FAIL, orGEARMAN_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_FATALtype GEARMAN_FAILβ The function failed to complete the job.GEARMAN_FATALis the deprecated name forGEARMAN_FAIL.type GEARMAN_ERRORβ A task has had an error and will be retried.type GEARMAN_SHUTDOWNβGEARMAN_SHUTDOWNis a special case. If it is returned the client will be sentGEARMAN_SUCCESS, butgearman_worker_work()will exit withGEARMAN_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_MAGICtype GEARMAN_INVALID_COMMANDtype GEARMAN_INVALID_PACKETtype GEARMAN_UNEXPECTED_PACKETtype GEARMAN_TOO_MANY_ARGS
π DEPRECATED π
(these are giving old-money legacy code β leave them alone bestie)
type GEARMAN_IGNORE_PACKETtype GEARMAN_MAX_RETURN
π₯ SEE ALSO π₯
gearmand(8) libgearman(3) gearman_client_error() or gearman_worker_error()
π Author π
Data Differential http://www.datadifferential.com/
π Copyright π
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
- ubuntu resolute: libgearman-dev 1.1.21+ds-1ubuntu3 Β· BSD-3-Clause
- ubuntu stonking: libgearman-dev 1.1.21+ds-1ubuntu3 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms