I have queued a qbo3 API call importfile/import
to bulk import a file with 80M records. The job completes successfully, but continues to run. The logging shows:
- Queued @ 2:39:42 AM
- Processing @ 2:39:54 AM
- Processing @ 3:39:57 AM
- Success @ 3:54:29 AM
- Processing @ 4:40:04 AM
- Success @ 5:11:16 AM
- Processing @ 5:40:09 AM
- ... and so on ...
How do I prevent repeated executions.
The root cause of this issue is Amazon's SQS visibility timeout, which defaults to 1 hour (3600 seconds). The clue to this answer is in the log's Processing times being almost exactly 1 hour apart:
What's happening is:
The solution is to extend the SQS visibility timeout to be greater than the maximum time you expect any job to take to be successful.
The easiest way to do this is set the application setting
qbo.Queue.Amazon.Properties.Settings.SQSVisibilityTimeout
via aSystemDefault
. In this case, the job took about 90 minutes; consider making the timeout 14400 seconds (4 hours).From Home > Import > Test Harness, import the following: