Action trigger mechanism not handling null/undef values for grouping field

Bug #1660059 reported by Chris Sharp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Undecided
Unassigned

Bug Description

For an action_trigger.event_definition that uses action.hold_request.sms_notify as the Processing Group Context Field/group_field, the event processing shows multiple Perl warnings:

open-ils.trigger: [WARN:18493:Application.pm:590:] open-ils.trigger.event.find_pending_by_group: Use of uninitialized value $ident_value in hash element at /usr/local/share/per
l/5.18.2/OpenILS/Application/Trigger.pm line 786.
open-ils.trigger: [WARN:18493:Application.pm:590:] open-ils.trigger.event.find_pending_by_group: Use of uninitialized value $ident_value in hash element at /usr/local/share/per
l/5.18.2/OpenILS/Application/Trigger.pm line 787.

and the open-ils.trigger dies off, possibly when receiving the large number of error messages (I haven't verified this part, but it's my working theory).

Tracing this to the relevant code in Trigger.pm shows that there is a check to make sure that the fieldmapper object actually exists ($node), but then assumes that the $ident_value (the actual field) is defined/not null.

Adding an additional check fixes the problem.

Branch on the way.

Evergreen 2.11.1+
OpenSRF 2.4.1
PostgreSQL 9.4
Ubuntu 14.04 LTS

Revision history for this message
Chris Sharp (chrissharp123) wrote :
Changed in evergreen:
milestone: none → 2.11.3
tags: added: pullrequest
Revision history for this message
Chris Sharp (chrissharp123) wrote :

Okay, after testing the above branch for a few days, it's causing an issue where all available cstore processes for open-ils.trigger are immediately consumed after the event collection process. I'm trying to figure out the problem with little luck so far.

Revision history for this message
Mike Rylander (mrylander) wrote :

Here's a branch to address the original report, as well as the followup issue with cstore exhaustion. From the commit message:

If a nullable event grouping field is configured, and a null value is indeed encountered when pulling together events, the Action/Trigger code will exit unceremoniously. To prevent this, we will now collect events with either a null grouping object or grouping field, and use a new batch invalidation API call to get rid of them as quickly as possible after group sorting is complete.

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=commitdiff;h=b3f7dd8557bc53a31bf097e92795e28b6a92fa1f

Revision history for this message
Chris Sharp (chrissharp123) wrote :
tags: added: signedoff
Revision history for this message
Mike Rylander (mrylander) wrote :

Thanks for testing and signoff, Chris! Picked to 2.10, 2.11 and master.

Changed in evergreen:
status: New → Fix Committed
Changed in evergreen:
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.