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

Migrate to mirai 2.0.0 #197

Merged
merged 130 commits into from
Jan 28, 2025
Merged

Migrate to mirai 2.0.0 #197

merged 130 commits into from
Jan 28, 2025

Conversation

wlandau
Copy link
Owner

@wlandau wlandau commented Jan 27, 2025

Prework

Related GitHub issues and pull requests

Summary

  • Avoid partial match in a call to crew_terminate_process().
  • Migrate to mirai 2.0.0 with the pair 1 poly protocol (Migrate to mirai 2.0 #193). Most notably, all workers now share the same URL instead of having different web sockets for different workers. This gets rid of crew's previous "slotted" model for workers.
  • Prohibit duplicated task names in push(). (The task must be popped first before another task of the same name can be submitted.) This allows controllers to use hash tables to track tasks, which makes push() and pop() orders of magnitude faster. It is also needed for the new retry mechanism based on backup controllers and controller groups.
  • Use exponential backoff in throttles.
  • Share throttles between scale() and wait() to increase responsiveness.
  • Use a unified throttle for controller groups, which requires refactoring wait(mode = "all") for controller groups.
  • Name every task and record every command.
  • Switch URLs from ws:// (and wss://) to tcp:// (and tls+tcp://) (Migrate to mirai 2.0 #193).
  • Change R-level error status code to -1 (previously 1).
  • Add a queue class for resolved tasks to make pop() and collect() more efficient. pop() is 64 times faster.
  • For clarity, rename the "launcher" column of the results to "controller".
  • Log crashes and cancellations separately from ordinary errors in summary().

Remarks

The package coverage workflow is failing on GitHub Actions. I don't know why, but dozens of testthat tests are failing in that workflow. I don't know why. It passes locally and covr reports 100% coverage there.

Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (b6207f2) to head (2106267).
Report is 131 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main      #197    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           30        32     +2     
  Lines         2257      2487   +230     
==========================================
+ Hits          2257      2487   +230     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wlandau wlandau merged commit 0df5bf1 into main Jan 28, 2025
17 checks passed
@wlandau wlandau deleted the 193 branch January 28, 2025 13:35
@wlandau wlandau mentioned this pull request Jan 28, 2025
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.

1 participant