AsyncConnectionPool: a session_callback that raises leaves the connection counted busy, so acquire() later hangs
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 75/100
Rechercherichtung
Start at the async connection pool's acquire path and trace how it handles a session_callback exception; compare it with the sync pool behavior described in the issue. Add or update a regression test using max=1 and a callback that raises once, checking that a subsequent acquire succeeds and the pool no longer counts the failed connection as busy.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Describe the problem
If a pool's session_callback raises, acquire() raises the error, but the pool still counts the new connection as busy. In an AsyncConnectionPool, that connection is never returned. Once the pool is at max, every later acquire() waits for ever.
A sync pool also leaves busy at 1 after the failure, but its next acquire() succeeded in my test.
Calling pool.drop(connection) inside the callback before re-raising works around it: busy and opened go back to 0.
Versions
- python-oracledb 26.0.1, Thin mode
- Python 3.13.6, macOS (arm64)
- Oracle Database Free 23.26 (
gvenzl/oracle-free:23-faststart)
To reproduce
import asyncio, gc
import oracledb
async def main(dsn, user, password):
calls = 0
async def callback(connection, tag):
nonlocal calls
calls += 1
if calls == 1:
raise RuntimeError("refused")
pool = oracledb.create_pool_async(user=user, password=password, dsn=dsn, min=0, max=1,
session_callback=callback)
try:
await pool.acquire()
except RuntimeError:
pass
gc.collect()
print("busy", pool.busy, "opened", pool.opened) # busy 1 opened 1
await asyncio.wait_for(pool.acquire(), 15) # TimeoutError
Output:
busy 1 opened 1
TimeoutError (second acquire, after 15 s)
Expected
When the session callback fails, the pool should drop the connection (or release it), so the next acquire() can open a new session.
- Vorherrschende Sprache
- Python
- Sterne
- 456
- Forks
- 119
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus oracle/python-oracledb
-
Thin mode: ORA-01483 for string binds of 2731-8191 bytes on a database with the UTF8 character setOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
oracle/python-oracledb#627 · 1 Kommentar ·
-
bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
oracle/python-oracledb#625 ·
-
bug
Schwierigkeit 4/5 1-2 Tage Anfängerfreundlichkeit 45/100
oracle/python-oracledb#624 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
oracle/python-oracledb#623 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
oracle/python-oracledb#622 ·
Alle Issues in oracle/python-oracledb
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
bug(sdk): add_toleration_json silently drops camelCase tolerationSeconds for static dict/list inputEvtl. vergeben @ravikumar266 hat das heute übernommen. Offenarea/sdk kind/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
kubeflow/pipelines#15347 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
predict_file with crop_model duplicates predictions once per imageEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
weecology/DeepForest#1445 ·
-
agent-ready priority: medium status: ready
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
melodic-software/claude-code-plugins#11864 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
PolicyEngine/policyengine-uk#2785 ·
Maintainer antworten meist innerhalb von 2 Tagen