gearman_client_set_exception_fn does not work, unless "exceptions" server option set

Bug #1040718 reported by Kirby Files on 2012-08-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gearman
Wishlist
Brian Aker

Bug Description

From the (terse) documentation on gearman_client_set_exception_fn(), a developer would expect that the following would cause "exception_callback" to be executed for any exceptions:

gearman_client_set_exception_fn(client, exception_callback);

However, no exceptions are returned to the client. *UNLESS* the code also executes:
   const char *EXCEPTIONS="exceptions";
   gearman_client_set_server_option(client, EXCEPTIONS, strlen(EXCEPTIONS));

This dependency is undocumented, and moreover, unnecessary. By calling gearman_client_set_exception_fn(), a developer is clearly expressing the intention to receive exceptions. So the call to gearman_client_set_server_option() should be executed internally by the library code when the exception_fn is registered.

Brian Aker (brianaker) wrote :

This behavior was copied from the original perl server. I feel like there is a reason why it exists,... but I am not sure.

You are right about this needing to be documented.

Brian Aker (brianaker) wrote :

This has now been added to the documentation. I am also creating a TODO on having this be an option that can be enabled on startup of the server.

Changed in gearmand:
assignee: nobody → Brian Aker (brianaker)
importance: Undecided → Wishlist
status: New → Confirmed
Brian Aker (brianaker) wrote :

gearmand --exceptions has been added.

Changed in gearmand:
milestone: none → 1.0.2
Brian Aker (brianaker) on 2012-11-10
Changed in gearmand:
status: Confirmed → Fix Committed
Brian Aker (brianaker) on 2013-08-22
Changed in gearmand:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers