Skip to content
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

fix: progress display race condition can result in LiveError #432

Merged
merged 1 commit into from
Jan 6, 2025
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
4 changes: 4 additions & 0 deletions src/halmos/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from enum import Enum
from importlib import metadata

import rich
from rich.status import Status
from z3 import (
Z3_OP_CONCAT,
Expand Down Expand Up @@ -753,6 +754,9 @@ def future_callback(future_model):

# display assertion solving progress
if not args.no_status or args.early_exit:
# creating a new live display would fail if the previous one was still active
rich.get_console().clear_live()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you elaborate on the race condition scenarios? my goal was to ensure only a single Status instance exists at a time. is it not the case, or is the Live instance a different thing from Status?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update from offline discussion: it's not super clear, but it might be related to the use of context manager within generator.

with Status("") as status:
while True:
if args.early_exit and len(counterexamples) > 0:
Expand Down
Loading