Fix the query tool issue 'pgAdminThread' object has no attribute 'native_id'. #6660

pull/6665/head
Khushboo Vashi 2023-08-08 11:00:52 +05:30 committed by GitHub
parent f399b30605
commit c72e2f159d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -920,7 +920,9 @@ def poll(trans_id):
is_thread_alive = False is_thread_alive = False
if trans_obj.get_thread_native_id(): if trans_obj.get_thread_native_id():
for thread in threading.enumerate(): for thread in threading.enumerate():
if thread.native_id == trans_obj.get_thread_native_id() and\ _native_id = thread.native_id if hasattr(thread, 'native_id'
) else thread.ident
if _native_id == trans_obj.get_thread_native_id() and\
thread.is_alive(): thread.is_alive():
is_thread_alive = True is_thread_alive = True
break break

View File

@ -162,7 +162,9 @@ class StartRunningQuery:
current_app._get_current_object()) current_app._get_current_object())
) )
_thread.start() _thread.start()
trans_obj.set_thread_native_id(_thread.native_id) _native_id = _thread.native_id if hasattr(_thread, 'native_id'
) else _thread.ident
trans_obj.set_thread_native_id(_native_id)
StartRunningQuery.save_transaction_in_session(session_obj, StartRunningQuery.save_transaction_in_session(session_obj,
trans_id, trans_obj) trans_id, trans_obj)