GEARMAN_FAILED(3)
π NAME π
okay so bestie, this one is gearman_failed β part of the GEARMAN_FAILED(3) manual page, aka the Gearmand Documentation, which lives over at http://gearman.info/ π¦
β¨ 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 when you build, you compile and link with -lgearman π«Ά (do not forget the link flag, she will not link herself)
πΈ DESCRIPTION πΈ
gearman_return_t is the return/error type for literal every single call you make with gearman_client_st and gearman_worker_st. When things go right you get GEARMAN_SUCCESS back, and when they don't, you get an error instead. π
gearman_failed()β use this to see if the return value is a failing value, i.e. it's giving "something went wrong".gearman_strerror()β use this to print a text version of the error message, so you actually know what happened instead of just vibing with a mystery number.
Then the vibe check trio, fr fr:
gearman_success()returnstrueifGEARMAN_SUCCESS, or ifGEARMAN_NO_PENDING_TASKStests true. βgearman_failed()returnstrueif any value other thanGEARMAN_SUCCESSwas provided. πgearman_continue()returnstrueif any error related to non-blocking IO occurred. This one is the one you use for testing loops β no cap, that's literally its whole job.
π Possible values of gearman_return_t: π
GEARMAN_SUCCESSβ success, the moment we all live for β¨GEARMAN_NO_PENDING_TASKSβgearman_client_run_tasks()was called and it has completed all tasks assigned to the client. she's done, she's finished, periodt πGEARMAN_IO_WAITβ blocking IO was found.gearman_continue()can be used to test for this. πGEARMAN_ERRNOβ a system error occurred. Use eithergearman_client_errno()orgearman_worker_errno(). π₯GEARMAN_NO_ACTIVE_FDSβ no active connections were available.gearman_continue()can be used to test for this. π«GEARMAN_GETADDRINFOβ name resolution failed for a host. π΅GEARMAN_NO_SERVERSβ no servers have been provided for the client/worker. she's alone in the group chat πGEARMAN_LOST_CONNECTIONβ connection was lost to the given server. it's giving ghosted π»GEARMAN_MEMORY_ALLOCATION_FAILUREβ memory allocation failed. πGEARMAN_SERVER_ERRORβ an error occurred on the server.GEARMAN_NOT_CONNECTEDβ client/worker is not currently connected to the server.GEARMAN_COULD_NOT_CONNECTβ server name was valid, but a connection could not be made. so close yet so far π§οΈGEARMAN_ECHO_DATA_CORRUPTIONβ eithergearman_client_echo()orgearman_worker_echo()echo was unsuccessful because the data was returned from gearmand corrupted. π©GEARMAN_UNKNOWN_STATEβ thegearman_return_twas never set. mystery era πGEARMAN_FLUSH_DATAβ internal state, should never be seen by either client or worker. do not perceive her π«£GEARMAN_SEND_BUFFER_TOO_SMALLβ send buffer was too small.GEARMAN_TIMEOUTβ a timeout occurred when making a request to the server. β°GEARMAN_ARGUMENT_TOO_LARGEβ argument was too large for the current buffer.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 π
GEARMAN_NEED_WORKLOAD_FNβ a client was asked for work, but nogearman_workload_fncallback was specified. Seegearman_client_set_workload_fn(). πGEARMAN_WORK_FAILβ a task has failed, and the worker has exited with an error or it calledgearman_job_send_fail(). πGEARMAN_IN_PROGRESSβgearman_client_job_status()has been called for agearman_job_handle_tand the Job is currently being run by a worker. she's busy bestie πβοΈ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 π§
GEARMAN_INVALID_FUNCTION_NAMEβ a worker was sent a request for a job that it did not have a valid function for. wrong number energy π΅GEARMAN_INVALID_WORKER_FUNCTIONβ no callback was provided by the worker for a given function.GEARMAN_NO_REGISTERED_FUNCTIONβ a request for removing a given function from a worker was invalid since that function did not exist.GEARMAN_NO_REGISTERED_FUNCTIONSβ the worker has not registered any functions. not one. zero. nada. πΆ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. iykyk π
GEARMAN_WORK_DATAβ worker has sent a chunked piece of data to the client viagearman_job_send_data(). π¦GEARMAN_WORK_WARNINGβ worker has issued a warning to the client viagearman_job_send_warning(). β οΈGEARMAN_WORK_STATUSβ status has been updated by the worker viagearman_job_send_status(). πGEARMAN_WORK_EXCEPTIONβ worker has sent an exception the client viagearman_job_send_exception(). π±GEARMAN_WORK_FAILβ a task has failed, and the worker has exited with an error or it calledgearman_job_send_fail(). πGEARMAN_WORK_ERRORβ a task has had an error and will be retried. π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, she said it twice π)
Any function defined by gearman_worker_define_function() may, and can only, return the following gearman_return_t values. that's the whole menu, no substitutions π½οΈ
GEARMAN_SUCCESSβ the function successfully completed the job. slay β¨GEARMAN_FATALβ (no description given, she's just standing there π§)GEARMAN_FAILβ the function failed to complete the job.GEARMAN_FATALis the deprecated name forGEARMAN_FAIL. πGEARMAN_ERRORβ a task has had an error and will be retried. πGEARMAN_SHUTDOWNβGEARMAN_SHUTDOWNis a special case. If it is returned the client will be sentGEARMAN_SUCCESS, butgearman_worker_work()will exit withGEARMAN_SHUTDOWN. plot twist π
π TASK ONLY π
GEARMAN_NOT_FLUSHINGβgearman_task_send_workload()failed, it was not in the correct state. π«GEARMAN_DATA_TOO_LARGEβgearman_task_send_workload()failed, the data was too large to be sent. πGEARMAN_UNKNOWN_OPTIONβ default state of task return value.
π PROTOCOL π
bestie listen. If any of these errors occurred, the connection will be dropped/reset. no negotiating. π₯
GEARMAN_INVALID_MAGICGEARMAN_INVALID_COMMANDGEARMAN_INVALID_PACKETGEARMAN_UNEXPECTED_PACKETGEARMAN_TOO_MANY_ARGS
π§οΈ DEPRECATED π§οΈ
GEARMAN_IGNORE_PACKETGEARMAN_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/
and that's the whole page bestie, you ate π mwah π«Ά
this was version 1.1.21+ds, dated Feb 04, 2026 β love that for us, see u next time β¨π
π¦ 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