A client called `run_in_transaction` be stuck if Spanner is down
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in packages/google-cloud-spanner/google/cloud/spanner_v1/database.py at run_in_transaction and its get_session call. Trace the transaction-running state when session creation fails while Spanner is unavailable, then add coverage for that failure path. Done means the client does not remain stuck and can retry when Spanner becomes available.
Written by the indexing model from the issue text.
Description
Determine this is the right repository
- I determined this is the correct repository in which to report this bug.
Summary of the issue
Context
When the Spanner is unavailable. If we call run_in_transaction, the Spanner client will stuck forever.
We believe the get_session should in the try catch block. Otherwise, the self._local.transaction_running = True will be forever True.
Expected Behavior:
The client will retry when the Spanner DB is back.
Actual Behavior:
The client stuck forever.
API client name and version
No response
Reproduction steps: code
No response
Reproduction steps: supporting files
- Try to create a session when Spanner is unavailable.
- The client will be stuck forever.
Reproduction steps: actual results
No response
Reproduction steps: expected results
No response
OS & version + platform
No response
Python environment
No response
Python dependencies
No response
Additional context
No response
- Dominant language
- Python
- Stars
- 5.4k
- Forks
- 1.8k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 93
Contributor 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 googleapis/google-cloud-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
googleapis/google-cloud-python#18428 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 76/100
googleapis/google-cloud-python#18339 ·
-
auth priority: p2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
googleapis/google-cloud-python#18315 ·
-
priority: p2 type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
googleapis/google-cloud-python#18260 ·
-
auth effort: low priority: p4 testing type: cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
googleapis/google-cloud-python#17760 ·
All issues in googleapis/google-cloud-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100