idle-in-transaction for harvest record selection

Aperta Adatta ai principianti
#6,514 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

@theyottaboy ci sta già lavorando.

Dal 21/11/2026.

  • #1118 di @theyottaboy — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
postgresql, python
Ambito
backend, databases

Direzione di ricerca

Inizia leggendo acquire_minimum_internal_data() e HarvesterDBInterface.get_latest_harvest_records_by_source_orm(), che l’issue identifica come il probabile percorso della query. Verifica come viene gestita la sessione durante la richiesta HTTP e se viene chiusa in ogni percorso di uscita. L’issue è risolta quando questo percorso non lascia più una transazione inattiva per oltre 60 secondi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

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 with anon_ means a subquery was used which the interface method HarvesterDBInterface.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 the idle-in-transaction state.
  • close the session in a finally statement in acquire_minimum_internal_data may resolve the issue.
Lingua principale
Python
Stelle
1.2k
Fork
207
Merge medio
3g 16h
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GSA/data.gov

Tutte le issue di GSA/data.gov

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.