idle-in-transaction for harvest record selection
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start by reading acquire_minimum_internal_data() and HarvesterDBInterface.get_latest_harvest_records_by_source_orm(), which the issue identifies as the likely query path. Check how the session is managed around the HTTP request and whether it is closed on every exit path. The issue is resolved when this path no longer leaves a transaction idle for over 60 seconds.
Written by the indexing model from the issue text.
Description
new relic alert indicating there's an idle-in-transaction lasting over 60 seconds.
How to reproduce
based on the history of this alert it doesn't appear there's a pattern.
Expected behavior
no idle in transactions over 60 seconds
Actual behavior
app code which causes transactions to sit idling over 60 seconds
Sketch
- the emitted query looks like
SELECT anon_1.identifier AS anon_1_identifier, anon_1.record_type AS anon_1_record_type, anon_1.source_hash AS anon_1_source_hash, anon_1.ckan_id AS anon_1_ckan_id, anon_1.date_created AS anon_1_date_created, anon_1.date_finished AS anon_1_date_finished,. emitted queries withanon_means a subquery was used which the interface methodHarvesterDBInterface.get_latest_harvest_records_by_source_orm()uses. the column order also matches those which are used in that function. acquire_minimum_internal_data()uses that function and is followed by an HTTP request to retrieve the external source. This pattern often times leaves a database transaction in theidle-in-transactionstate.- close the session in a
finallystatement inacquire_minimum_internal_datamay resolve the issue.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 207
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GSA/data.gov
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Harvester
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
-
blocked form submission shows home pagePossibly taken @FuhuXia claimed this 1 day ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Harvester pagination: add page-number navigation to paginationPossibly taken @jaredb96 claimed this 24 days ago. Openbug Harvester
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Similar issues
-
docs(contributing): the two things that silently block a PRPossibly taken A pull request linked to this issue is open or already merged. Openavailable documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
Nixitov/Riptide-Native#944 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
JTHCode/secretguard#24 ·
Maintainers usually reply within 1 day
-
area: middleware documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainers usually reply within 1 day