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(server): add a --replace option #567

Merged
merged 3 commits into from
Nov 24, 2023
Merged

Conversation

AltGr
Copy link
Collaborator

@AltGr AltGr commented Oct 27, 2023

Closes #529 which seemed to be a common complaint among teachers.

  • learn-ocaml serve --replace will kill an existing server (running on the
    same port) just before starting

  • learn-ocaml build serve with an existing server on the same port will fail
    fast (before actually doing the build)

  • learn-ocaml build serve --replace is more clever:

    • it will do the build in a temporary directory
    • then, only if everything is ok, kill the older server
    • swap the files and start the new server

This is all done in order to minimise downtime and be convenient for server
updates.

Note that this PR sits on top of #481 and should be rebased once it's
merged.

@erikmd erikmd added kind: feature New user-facing feature. needs: merge of dependency This PR depends on another PR being merged first. labels Oct 29, 2023
@AltGr AltGr added this to the learn-ocaml 1.0.0 milestone Oct 31, 2023
Closes ocaml-sf#529 which seemed to be a common complaint among teachers.

* `learn-ocaml serve --replace` will kill an existing server (running on the
  same port) just before starting

* `learn-ocaml build serve` with an existing server on the same port will fail
  fast (before actually doing the build)

* `learn-ocaml build serve --replace` is more clever:
  - it will do the build *in a temporary directory*
  - then, only if everything is ok, kill the older server
  - swap the files and start the new server

This is all done in order to minimise downtime and be convenient for server
updates.

Note that this PR sits on top of ocaml-sf#481 and should be rebased once it's merged.
This makes it easier to identify problem when one exercise is misbehaving (see
ocaml-sf/learn-ocaml-corpus@b6e1f61)
@erikmd
Copy link
Member

erikmd commented Nov 19, 2023

Thanks @AltGr, this enhancement is a must-have !!

I didn't finish my tests yet, but as I told you by e-mail I expect this to be done on this Monday Nov 20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: feature New user-facing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Ensure learn-ocaml build serve immediately handles requests at second run
2 participants