libgearman server option handling

Bug #1098413 reported by Keyur
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gearman
Fix Released
Low
Brian Aker

Bug Description

Server options need to be preserved across connect/disconnect cycles (as seen in https://bugs.launchpad.net/gearmand/+bug/1098409). They need to be resent 'automatically' every time a reconnect happens internally inside libgearman.

The current API design does not allow for this; the caller need to be aware and "re-set" the option by calling gearman_client_set_server_option() again.

The proposed patch works by storing the option and delaying the actual network-io until an "real" data-packet needs to go across to the server.

Along with the benefit of graceful reconnection handling, it will also fix an inconsistency: consider a client with multiple servers added in. In the old design, if one of the servers was down but the other was up, the API call gearman_client_set_server_option() would fail hard.

This is unlike how say the gearman_client_do_background() API works. It will try to send the request over to all servers and only return failure if all of them are down. By delaying, we emulate this behavior.

In case a bad option is set, a new error code GEARMAN_INVALID_SERVER_OPTION is returned.

Revision history for this message
Keyur (keyurdg) wrote :
Revision history for this message
Keyur (keyurdg) wrote :

I'm stupid. Missed the 2 new files server_options.*

Attached now :)

Revision history for this message
Keyur (keyurdg) wrote :

Patches are based off of v1.0.2

Brian Aker (brianaker)
Changed in gearmand:
milestone: none → 1.0.3
assignee: nobody → Brian Aker (brianaker)
importance: Undecided → Low
status: New → In Progress
Brian Aker (brianaker)
Changed in gearmand:
status: In Progress → 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.