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

env (interactive mode): timeout for blocking operations #440

Merged

Conversation

mtrofin
Copy link
Collaborator

@mtrofin mtrofin commented Feb 12, 2025

The opening of the communication named pipes and the
read operations are blocking. This introduces a timeout.

High level:

  • we associate a thread with open, which waits for a signal
    (Event), with a timeout. If it times out, the thread opens
    the associated pipe, which unblocks the main open

  • writes aren't expected to block

  • reads are. To address, we poll (select.select) before reading,
    with a timeout.

The design treats the timeout as resetting for each blocking op.
This is just to simplify the design - rather than checking passed
time.

Created using spr 1.3.5
Created using spr 1.3.5
Created using spr 1.3.5

[skip ci]
Created using spr 1.3.5
@mtrofin mtrofin requested a review from svkeerthy February 12, 2025 20:43
Copy link
Collaborator

@boomanaiden154 boomanaiden154 left a comment

Choose a reason for hiding this comment

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

Some initial comments. i'd like to go through the tests a bit more thoroughly when I have chance.

compiler_opt/rl/env.py Show resolved Hide resolved
compiler_opt/rl/env.py Outdated Show resolved Hide resolved
compiler_opt/rl/env.py Show resolved Hide resolved
Created using spr 1.3.5
Created using spr 1.3.5

[skip ci]
Created using spr 1.3.5
Created using spr 1.3.5

[skip ci]
Created using spr 1.3.5
@mtrofin mtrofin changed the base branch from spr/mtrofin/main.env-interactive-mode-timeout-for-blocking-operations to main February 13, 2025 19:19
Created using spr 1.3.5
@mtrofin mtrofin merged commit d04ae3b into main Feb 14, 2025
15 checks passed
@mtrofin mtrofin deleted the spr/mtrofin/env-interactive-mode-timeout-for-blocking-operations branch February 14, 2025 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants