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

feat: notifications delay new request handling while running #183

Merged
merged 10 commits into from
Aug 31, 2021

Conversation

pnwamk
Copy link
Contributor

@pnwamk pnwamk commented Aug 26, 2021

Makes it so that the handling of a notification cannot be interrupted/interleaved with new commands/queries/notifications. This may be enough to fix GaloisInc/cryptol#1261

Tweaking the default state eviction policy to remove older requests automatically instead of reject new ones if the server is full (thus removing the need for scripts to call reset when connecting) may also be helpful.

@pnwamk pnwamk force-pushed the fix-interleaving-reqs branch 2 times, most recently from 0374aab to 28a00aa Compare August 28, 2021 01:15
@pnwamk
Copy link
Contributor Author

pnwamk commented Aug 28, 2021

This set of changes has two main consequences:

  1. cryptol/saw python scripts should not have to reset the server each time they connect; new connections' states take precedence over older connections' states and the older states are auto-evicted when the server hits it's capacity. The capacity can be customized from the command line (--max-occupancy NUM) and the old behavior (i.e., not auto evicting) can be regained from the command line as well (--no-evict)
  2. the "unknown state ID" errors should be a thing of the past because (a) now that we can skip resetting the server (which was the request occasionally "colliding" with the subsequent request on the server) and (b) several measures have been taken to ensure that even if people send notifications (such as a reset server command) they should not be interrupted and/or conflict with requests immediately following them. I have tested this locally (i.e., running a program that reliably caused the error previously in a loop) with the cryptol server and even with the reset_server=True flag (which we no longer need) no unknown state errors occurred.

@pnwamk pnwamk requested a review from m-yac August 30, 2021 15:23
Copy link
Contributor

@m-yac m-yac left a comment

Choose a reason for hiding this comment

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

This looks awesome! I have a few questions, but they could just be due to me not having a full understanding of this codebase yet.

argo/src/Argo.hs Outdated Show resolved Hide resolved
argo/src/Argo.hs Outdated Show resolved Hide resolved
argo/src/Argo/DefaultMain.hs Show resolved Hide resolved
argo/src/Argo/DefaultMain.hs Show resolved Hide resolved
argo/src/Argo.hs Show resolved Hide resolved
Copy link

@atomb atomb left a comment

Choose a reason for hiding this comment

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

This looks good to me. I hope we don't need to keep the delay in the Python client for long, and can figure out how to remove the need on the server side, but I think it's okay to include for now.

argo/src/Argo/DefaultMain.hs Show resolved Hide resolved
python/argo_client/connection.py Outdated Show resolved Hide resolved
@pnwamk pnwamk merged commit 6ca9206 into master Aug 31, 2021
@pnwamk pnwamk deleted the fix-interleaving-reqs branch August 31, 2021 00:46
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.

Unknown state ID errors in CI
3 participants