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

Update swirl #1677

Merged
merged 2 commits into from
Apr 1, 2019
Merged

Update swirl #1677

merged 2 commits into from
Apr 1, 2019

Conversation

sgrif
Copy link
Contributor

@sgrif sgrif commented Mar 18, 2019

New features in this version:

  • Codegen for jobs which reduces boilerplate when defining them
  • Jobs no longer need to be registered with the runner
  • Rework of how run_all_pending_jobs works so errors loading the job
    actually bubble up
  • Configurable timeout for how long to wait for a job to begin running

We aren't fully taking advantage of the timeout yet, I'd eventually like
to try rebuilding the runner in-process a few times when an error
happens, and then crash the process if it fails a few times in a row.
This needs a bit more refactoring though (I'm not sure if we want to
keep the Repository in memory like we are now, and whether we want to
assume a full re-clone is needed on error). For now I've set it to
ensure our jobs don't hang forever though.

Warts in this version:

Issues with this version:

  • The new impl of run_all_pending_jobs will return an error if the DB
    is in read only mode. If the DB is read only, we couldn't have
    enqueued jobs anyway, so the workaround is "fine", but we need some
    more robust APIs in swirl to fix this. This only affects us in tests.

New features in this version:

- Codegen for jobs which reduces boilerplate when defining them
- Jobs no longer need to be registered with the runner
- Rework of how `run_all_pending_jobs` works so errors loading the job
  actually bubble up
- Configurable timeout for how long to wait for a job to begin running

We aren't fully taking advantage of the timeout yet, I'd eventually like
to try rebuilding the runner in-process a few times when an error
happens, and then crash the process if it fails a few times in a row.
This needs a bit more refactoring though (I'm not sure if we want to
keep the `Repository` in memory like we are now, and whether we want to
assume a full re-clone is needed on error). For now I've set it to
ensure our jobs don't hang forever though.

Warts in this version:

- Rust thinks imports only used in the job body are unused.
  (sgrif/swirl#6)
  - Worked around for now by moving the imports into the job body
- `swirl::Job` has to be imported by calling code
- Codegen assumes that `serde::Deserialize` and `serde::Serialize` are
  available. (sgrif/swirl#9)

Issues with this version:

- The new impl of `run_all_pending_jobs` will return an error if the DB
  is in read only mode. If the DB is read only, we couldn't have
  enqueued jobs anyway, so the workaround is "fine", but we need some
  more robust APIs in swirl to fix this. This only affects us in tests.
  - sgrif/swirl#8
@sgrif
Copy link
Contributor Author

sgrif commented Mar 18, 2019

Note: Diff stats are mostly just indentation changes. There's no substantial changes to the job bodies other than removing self.

@bors
Copy link
Contributor

bors commented Mar 20, 2019

☔ The latest upstream changes (presumably #1679) made this pull request unmergeable. Please resolve the merge conflicts.

@sgrif sgrif requested a review from jtgeibel March 22, 2019 19:15
@jtgeibel
Copy link
Member

jtgeibel commented Apr 1, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Apr 1, 2019

📌 Commit be5f0de has been approved by jtgeibel

@bors
Copy link
Contributor

bors commented Apr 1, 2019

⌛ Testing commit be5f0de with merge 991f53c...

bors added a commit that referenced this pull request Apr 1, 2019
Update swirl

New features in this version:

- Codegen for jobs which reduces boilerplate when defining them
- Jobs no longer need to be registered with the runner
- Rework of how `run_all_pending_jobs` works so errors loading the job
  actually bubble up
- Configurable timeout for how long to wait for a job to begin running

We aren't fully taking advantage of the timeout yet, I'd eventually like
to try rebuilding the runner in-process a few times when an error
happens, and then crash the process if it fails a few times in a row.
This needs a bit more refactoring though (I'm not sure if we want to
keep the `Repository` in memory like we are now, and whether we want to
assume a full re-clone is needed on error). For now I've set it to
ensure our jobs don't hang forever though.

Warts in this version:

- Rust thinks imports only used in the job body are unused.
  (sgrif/swirl#6)
  - Worked around for now by moving the imports into the job body
- `swirl::Job` has to be imported by calling code
- Codegen assumes that `serde::Deserialize` and `serde::Serialize` are
  available. (sgrif/swirl#9)

Issues with this version:

- The new impl of `run_all_pending_jobs` will return an error if the DB
  is in read only mode. If the DB is read only, we couldn't have
  enqueued jobs anyway, so the workaround is "fine", but we need some
  more robust APIs in swirl to fix this. This only affects us in tests.
  - sgrif/swirl#8
@bors
Copy link
Contributor

bors commented Apr 1, 2019

☀️ Test successful - checks-travis
Approved by: jtgeibel
Pushing 991f53c to master...

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.

3 participants