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

[WIP] Copy-on-Write forking (logic copied from Puma) #1160

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
54eba86
Adds support for running as a forking process in the foreground
johnnyshields Apr 4, 2021
3401c24
Cleanup behavior for Command#launch and #daemonize
johnnyshields Apr 4, 2021
d328cb8
Prevent specs from creating stray directories
johnnyshields Apr 5, 2021
dd0db79
Fix rake tasks
johnnyshields Apr 5, 2021
40d9f04
More fixes to rake command parsing
johnnyshields Apr 5, 2021
0a7145f
- Add tests for Rake tasks
johnnyshields Apr 5, 2021
9d0d3fe
Make life easy and require all files at boot time
johnnyshields Apr 5, 2021
246936c
Revert require of Command
johnnyshields Apr 5, 2021
ea83992
Fix edge case where queues are nil
johnnyshields Apr 6, 2021
2c87350
Improve log message
johnnyshields Apr 6, 2021
853efa9
Fix CI
johnnyshields Apr 6, 2021
ed855a4
Try again
johnnyshields Apr 6, 2021
226d6d8
Fix spec
johnnyshields Apr 6, 2021
7f284da
Add continue-on-error to steps
johnnyshields Apr 6, 2021
6f225da
Fix spec
johnnyshields Apr 6, 2021
a17c488
Ignore process messages from non-workers
johnnyshields Apr 6, 2021
0d06a33
Fix rubocop
johnnyshields Apr 6, 2021
293522b
Shutdown after child killed with 30 sec grace period.
johnnyshields Apr 7, 2021
60ccd9a
Fix bug
johnnyshields Apr 7, 2021
6ab0d17
Cleanup logging
johnnyshields Apr 7, 2021
e52508a
Support Copy-on-Write forking from first worker. Code is borrowed fro…
johnnyshields Jan 9, 2022
cc26386
Port more code from Puma
johnnyshields Jan 9, 2022
1e4b105
Fix specs
johnnyshields Jan 9, 2022
d1bef03
Log via queue
johnnyshields Jan 9, 2022
0b57172
Remove time from log
johnnyshields Jan 9, 2022
ebbc778
Run worker on thread
johnnyshields Jan 9, 2022
e6efe21
Fix Class name
johnnyshields Jan 9, 2022
20bac34
Fix logger in child class
johnnyshields Jan 9, 2022
98225b4
Fix ping method
johnnyshields Jan 9, 2022
759b67d
Fix spec
johnnyshields Jan 9, 2022
aa2a012
Fix one more bug
johnnyshields Jan 9, 2022
92eee8d
Fix bug
johnnyshields Jan 9, 2022
7713000
Fix issue with ping
johnnyshields Jan 9, 2022
8eef0c2
Fix phased_restart
johnnyshields Jan 9, 2022
813fe78
Fix single mode
johnnyshields Jan 9, 2022
6a13532
Fix logging
johnnyshields Jan 9, 2022
e6c8a9d
Fix logger
johnnyshields Jan 9, 2022
b904f12
Port more signal handling from Puma
johnnyshields Jan 10, 2022
2573b46
Add one more line
johnnyshields Jan 10, 2022
f8166f9
Fix graceful stop on term
johnnyshields Jan 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 43 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,68 @@ on:
jobs:
test:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental || false }}
strategy:
fail-fast: false
matrix:
ruby: [2.5, 2.6, 2.7, jruby, jruby-head, ruby-head]
ruby:
- '2.5'
- '2.6'
- '2.7'
- '3.0'
- 'jruby'
rails_version:
- '5.2.0'
- '6.0.0'
- '6.1.0.rc2'
- 'edge'
- '6.0'
- '6.1'
include:
#
# The past
#
# EOL Active Record
- ruby: 2.2
rails_version: '3.2.0'
- ruby: 2.1
rails_version: '4.1.0'
- ruby: 2.4
rails_version: '4.2.0'
- ruby: 2.4
rails_version: '5.0.0'
- ruby: 2.5
rails_version: '5.1.0'

continue-on-error: ${{ matrix.rails_version == 'edge' || endsWith(matrix.ruby, 'head') }}
# Older Rails
- ruby: '2.2'
rails_version: '3.2'
- ruby: '2.1'
rails_version: '4.1'
- ruby: '2.4'
rails_version: '4.2'
- ruby: '2.4'
rails_version: '5.0'
- ruby: '2.5'
rails_version: '5.1'
- ruby: '2.5'
rails_version: '5.2'
- ruby: 'jruby'
rails_version: '5.2'
# Experimental
- ruby: 'ruby-head'
rails_version: '6.1'
experimental: true
- ruby: 'jruby-head'
rails_version: '6.1'
experimental: true
- ruby: '2.7'
rails_version: 'edge'
experimental: true
- ruby: '3.0'
rails_version: 'edge'
experimental: true
- ruby: 'jruby'
rails_version: 'edge'
experimental: true

steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
continue-on-error: ${{ matrix.experimental || false }}
env:
RAILS_VERSION: ${{ matrix.rails_version }}
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
continue-on-error: ${{ matrix.experimental || false }}
env:
RAILS_VERSION: ${{ matrix.rails_version }}
run: bundle exec rspec
- name: Coveralls Parallel
continue-on-error: ${{ matrix.experimental || false }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
Expand Down
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ SignalException:
SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space

Style/SpecialGlobalVars:
Enabled: false

Style/SymbolArray:
Enabled: false

Expand Down
20 changes: 11 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ source 'https://rubygems.org'

gem 'rake'

platforms :ruby do
# Rails 5.1 is the first to work with sqlite 1.4
# Rails 6 now requires sqlite 1.4
if ENV['RAILS_VERSION'] && ENV['RAILS_VERSION'] < '5.1'
gem 'sqlite3', '< 1.4'
else
gem 'sqlite3'
end
end
gem 'sqlite3'

# platforms :ruby do
# # Rails 5.1 is the first to work with sqlite 1.4
# # Rails 6 now requires sqlite 1.4
# if ENV['RAILS_VERSION'] && ENV['RAILS_VERSION'] < '5.1'
# gem 'sqlite3', '< 1.4'
# else
# gem 'sqlite3'
# end
# end

platforms :jruby do
if ENV['RAILS_VERSION'] == '4.2.0'
Expand Down
File renamed without changes.
Loading