Skip to content

Fixed bug #24 : QA could hung when starting trace session #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions src/firebird/qa/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1265,17 +1265,24 @@ def trace_thread(act: Action, b: Barrier, cfg: List[str], output: List[str], kee
role: User role
stop: Event used to stop the trace thread
"""
with act.connect_server(encoding=encoding, encoding_errors=encoding_errors,
user=user, password=password) as srv:
output.append(srv.trace.start(config='\n'.join(cfg)))
b.wait()
while not stop.is_set():
line = srv.readline_timed(1)
if line is not TIMEOUT:
if not line:
stop.set()
elif keep_log:
output.append(line)
connected = False
try:
with act.connect_server(encoding=encoding, encoding_errors=encoding_errors,
user=user, password=password) as srv:
output.append(srv.trace.start(config='\n'.join(cfg)))
b.wait()
connected = True
while not stop.is_set():
line = srv.readline_timed(1)
if line is not TIMEOUT:
if not line:
stop.set()
elif keep_log:
output.append(line)
except:
if not connected:
b.wait()
raise

class TraceSession:
"""Object to manage Firebird trace session.
Expand Down