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

Bug #1040718 reported by Kirby Files
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gearman
Fix Released
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.

Revision history for this message
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.

Revision history for this message
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
Revision history for this message
Brian Aker (brianaker) wrote :

gearmand --exceptions has been added.

Changed in gearmand:
milestone: none → 1.0.2
Brian Aker (brianaker)
Changed in gearmand:
status: Confirmed → Fix Committed
Brian Aker (brianaker)
Changed in gearmand:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.