File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ Thin Mode Changes
22
22
#) Emulate support for :meth: `Queue.deqmany() ` with JSON payloads when using
23
23
Oracle Database 21c by internally calling :meth: `Queue.deqone() ` as many
24
24
times as needed.
25
+ #) Fixed bug when a connection pool internally makes an attempt to ping a
26
+ closed connection
27
+ (`issue 482 <https://github.com/oracle/python-oracledb/issues/482 >`__).
25
28
#) Fixed bug when connecting with asyncio using the parameter ``https_proxy ``.
26
29
#) Fixed regression when connecting where only the host specified by the
27
30
``https_proxy `` parameter can successfully perform name resolution.
Original file line number Diff line number Diff line change @@ -660,10 +660,13 @@ cdef class ReadBuffer(Buffer):
660
660
cdef:
661
661
bint notify_waiter
662
662
Packet packet
663
- packet = self ._transport.read_packet()
664
- self ._process_packet(packet, & notify_waiter, False )
665
- if notify_waiter:
666
- self ._start_packet()
663
+ packet = self ._transport.read_packet(raise_exc = False )
664
+ if packet is None :
665
+ self ._pending_error_num = TNS_ERR_SESSION_SHUTDOWN
666
+ else :
667
+ self ._process_packet(packet, & notify_waiter, False )
668
+ if notify_waiter:
669
+ self ._start_packet()
667
670
668
671
cdef bint has_response(self ):
669
672
"""
Original file line number Diff line number Diff line change @@ -332,7 +332,7 @@ cdef class Transport:
332
332
self ._transport = transport
333
333
self ._transport_num = sock.fileno()
334
334
335
- cdef Packet read_packet(self ):
335
+ cdef Packet read_packet(self , bint raise_exc = True ):
336
336
"""
337
337
Reads a packet from the transport.
338
338
"""
@@ -344,10 +344,15 @@ cdef class Transport:
344
344
try :
345
345
data = self ._transport.recv(self ._max_packet_size)
346
346
except ConnectionResetError as e:
347
+ self ._transport = None
348
+ if not raise_exc:
349
+ return None
347
350
errors._raise_err(errors.ERR_CONNECTION_CLOSED, str (e),
348
351
cause = e)
349
352
if len (data) == 0 :
350
353
self .disconnect()
354
+ if not raise_exc:
355
+ return None
351
356
errors._raise_err(errors.ERR_CONNECTION_CLOSED)
352
357
packet = self .extract_packet(data)
353
358
return packet
You can’t perform that action at this time.
0 commit comments