action_trigger_runner.pl --max-sleep argument broken

Bug #1745001 reported by Josh Stompro on 2018-01-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Low
Unassigned
3.0
Low
Unassigned

Bug Description

EG 2.8-3.0

I just tried to make use of the --max-sleep argument to reduce the amount of time the action_trigger_runner.pl waits before giving up when it detects a lock file. The goal being to avoid having 20+ action_trigger_runner.pl scripts running for a cron task that runs every 5 minutes when there is a system issue that prevents the first one from finishing.

action_trigger_runner.pl --help shows the following info.
    --max-sleep=<seconds>
        When in process-hooks mode, wait up to <seconds> for the lock file to
        go away. Defaults to 3600 (1 hour).

But I found that when I use the --max-sleep=90 I get the following error message.

Option max-sleep does not take an argument Error in command line arguments! at /openils/bin/action_trigger_runner.pl line 44.

I think the issue is that the max-sleep option is entered has just being a flag.

  44 GetOptions(
  45 'max-sleep' => \$opt_max_sleep,
  46 'osrf-config=s' => \$opt_osrf_config,
  47 'run-pending' => \$opt_run_pending,
  48 'hooks=s' => \$opt_hooks,
  49 'granularity=s' => \$opt_granularity,
  50 'granularity-only' => \$opt_gran_only,
  51 'process-hooks' => \$opt_process_hooks,
  52 'debug-stdout' => \$opt_debug_stdout,
  53 'custom-filters=s' => \$opt_custom_filter,
  54 'lock-file=s' => \$opt_lockfile,
  55 'verbose' => \$opt_verbose,
  56 'help' => \$opt_help,
  57 );

There is no =i after 'max-sleep above. I think that adding =i will allow an integer value for that option.

working branch coming soon.
Josh

tags: added: pullrequest
Cesar V (cesardv) wrote :

Nice... max-sleep now works for me Josh, thanks.
Signed-off branch to follow...

I was wondering though whether the processed/"sample" Open-ILS/src/support-scripts/action_trigger_runner.pl be un-ignored, updated/committed, and re-ignored, so that it matches the .in one? Not sure what the protocol should be there...

Cesar V (cesardv) on 2018-03-16
tags: added: signedoff
Galen Charlton (gmc) on 2018-03-30
Changed in evergreen:
milestone: none → 3.1.1
status: New → Confirmed
importance: Undecided → Low
Changed in evergreen:
milestone: 3.1.1 → 3.1.2
Galen Charlton (gmc) on 2018-04-30
Changed in evergreen:
assignee: nobody → Galen Charlton (gmc)
Galen Charlton (gmc) wrote :

Pushed to master, rel_3_1, and rel_3_0. Thanks, Josh and Cesar!

Cesar: to answer your question, generated files like action_trigger_runner.pl should not be checked in.

Changed in evergreen:
status: Confirmed → Fix Committed
assignee: Galen Charlton (gmc) → nobody
Changed in evergreen:
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