Option to force-recycle drones after long-running sessions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenSRF |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
An OpenSRF drone process exits and dies after it serves its configured maximum number of requests. There are times, however, when it would make sense to let a drone die sooner to release resources (e.g. memory), particularly when a single API call or session runs for an extended period of time and does a lot of work. In such cases, the amount of work performed may be comparable to thousands of quick API calls.
Examples from Evergreen land include the hold targeter, potentially the fine generator (bug #1705728), and likely other batch processes.
One option is to allow the API code to specify that a call is long-running and that its processing drone should be recycled once the session completes. I created a simple (Perl) proof of concept branch that does this that I will post for feedback.
Changed in opensrf: | |
milestone: | 3.0.1 → 3.0.2 |
Changed in opensrf: | |
milestone: | 3.0.2 → 3.1-beta |
Changed in opensrf: | |
status: | New → Confirmed |
assignee: | nobody → Galen Charlton (gmc) |
Changed in opensrf: | |
status: | Fix Committed → Fix Released |
As promised:
http:// git.evergreen- ils.org/ ?p=working/ OpenSRF. git;a=shortlog; h=refs/ heads/user/ berick/ lp1706147- session- force-recycle- perl
From the commit:
Creates an API-level option to inform the OpenSRF drone management code that the running drone should be recycled upon completion of the current OpenSRF session. This allows for quicker release of resources consumed by the drone.
To use:
sub some_api_method { >session- >force_ recycle( 1);
my ($self, $client, ...) = @_;
$self-
...
}
While I could also see supporting this flag in the API registration chunk, being able to specify it dynamically is still required for multi-purpose (batch vs non-batch) APIs.