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

Timeout on cryptol-remote-api? #1147

Closed
michaelabernardo opened this issue Apr 5, 2021 · 7 comments
Closed

Timeout on cryptol-remote-api? #1147

michaelabernardo opened this issue Apr 5, 2021 · 7 comments
Assignees
Labels
priority For issues that should be solved sooner remote-api Related to Cryptol's remote API

Comments

@michaelabernardo
Copy link

Good morning!

Is there a way to timeout or kill a command running on cryptol-remote-api if it doesn't complete after a period of time? For example, if I was trying to run :prove on a number of proofs, but wanted cryptol-remote-api to stop and move on to the next proof if it took more than two minutes on any given proof. I've tried implementing a timeout through Python that kills the command on my script, but I think the server keeps spinning, at least for a time.

Thank you!

@pnwamk
Copy link
Contributor

pnwamk commented Apr 5, 2021

Unfortunately the python client and server do not have this feature yet -- I'm chatting with some folks here now about how we could most conveniently add both timeouts and interrupts to the interface. E.g., perhaps having an optional timeout keyword argument to the Python prove function (and any other SMT-reliant functions) will work nicely for most use cases and be easy to implement, while a more general ability to interrupt the server might take a little more engineering but could obviously handle more things and be more dynamic.

I'm exploring workarounds in the meantime to see if we can leverage the underlying timeout features some of the solvers have to get around the server not yet supporting it explicitly. If I find something that works I'll post it here. Experiments thus far have been unsuccessful =\

@pnwamk
Copy link
Contributor

pnwamk commented Apr 5, 2021

@michaelabernardo If you have any ideas/suggestions/preferences on what this feature would ideally look like from a user perspective please don't hesitate to share =)

@pnwamk
Copy link
Contributor

pnwamk commented Apr 5, 2021

It looks like the most straightforward way to address this issue is to properly expose the solver timeout option in the underlying library Cryptol uses on to interact with the various solvers (i.e., what4). Once that is done, it should be trivial to add an option to Cryptol and Cryptol's server & python client to let users customize timeout behavior as needed. I should have more info on how/when we can land some of these changes in the next couple of days.

More generally it would be nice to tweak the server so any request can be interrupted if there is a need to do so. This still needs further investigation to see what changes would be necessary.

@michaelabernardo
Copy link
Author

That sounds great! I think it would be nice to have a more general way to interrupt the server in the future, but the solver timeout will be very useful, as well.

@pnwamk pnwamk added the remote-api Related to Cryptol's remote API label Apr 6, 2021
@pnwamk
Copy link
Contributor

pnwamk commented Apr 23, 2021

Implementing proper interrupt handling (and not just timeouts) will likely relate to work done to fix this issue as well: #1167

@atomb atomb added the priority For issues that should be solved sooner label May 20, 2021
@pnwamk
Copy link
Contributor

pnwamk commented Jul 2, 2021

Merging of this PR will address the "timeout" aspect of this general problem: GaloisInc/what4#128
Planning to look into outright interruptibility in the server soon.

@RyanGlScott
Copy link
Contributor

If I understand correctly, this issue has been resolved:

Both of these are now in use in cryptol, so I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority For issues that should be solved sooner remote-api Related to Cryptol's remote API
Projects
None yet
Development

No branches or pull requests

4 participants