[meta] partners: don't hold a DB transaction open during the partner HTTP fetch
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
Research direction
Start in jobs/harvest_partner_outings.py at run_source: trace where partner_sources is read and where adapter.fetch is called. Read the job's session/transaction helper and any existing job tests or transport test double. Done means the row read is finished before the fetch, lookup cache writes are buffered in memory, outings/lookups/health are written in one short transaction, and a test proves no transaction is open while the transport is called.
Written by the indexing model from the issue text.
Description
From the M1 integration review of meta. Target branch: meta. Tracking: c2corg/metaskirando-archive#2
run_source (jobs/harvest_partner_outings.py) reads partner_sources and then keeps the transaction open through adapter.fetch. For gulliver that can mean up to 40 requests with 20 s timeouts and sleeps, so minutes "idle in transaction": a pinned connection, a row lock, and vacuum held back on prod (PostgreSQL 9.6).
Fix: read the row and end the transaction before the fetch. Keep the lookup cache writes in memory during the fetch, then write outings, lookups and health in one short transaction. Add a test asserting that no transaction is open while the transport is called.
Generated by Claude Code
- Dominant language
- Python
- Stars
- 25
- Forks
- 30
- Avg merge
- 8h 3m
- Merged PRs (30d)
- 255
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No 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 c2corg/v6_api
-
metaskirando
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug: api backend is not resilient to ES errorsPossibly taken @eddy-geek claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
metaskirando
Difficulty 3/5 Half a day Newbie friendliness 58/100
Maintainers usually reply within 1 day
-
metaskirando
Difficulty 3/5 1-2 days Newbie friendliness 42/100
Maintainers usually reply within 1 day
-
metaskirando
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Maintainers usually reply within 1 day
Similar issues
-
`gitlab_importer_v2` pipeline failing due to malformed YAML filePossibly taken @Gowri213 claimed this today. Openbug Pipeline: Failure Priority: high
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
aboutcode-org/vulnerablecode#2523 · 1 comment ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
intuitem/ciso-assistant-community#5380 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
confluentinc/cp-ansible#2767 ·
Maintainers usually reply within 3 days
-
bug docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 2 days