Commit Graph

11 Commits

Author SHA1 Message Date
MSP-Greg fa65cf7141
103 RuboCop fixes (#2976)
* rubocop.yml - add more Cops & alphabetize

* RuboCop - Performance/UnfreezeString

* RuboCop - Style/SafeNavigation

* RuboCop - Performance/StringInclude

* RuboCop - Performance/StringIdentifierArgument

* RuboCop - Performance/RegexpMatch

* RuboCop - Performance/MethodObjectAsBlock

* RuboCop - Performance/CollectionLiteralInLoop

* RuboCop - Performance/ChainArrayAllocation
2022-09-30 15:06:32 +09:00
MSP-Greg 2fbb09626a
Revert change to Server#initialize (new) method signature from #2798 (#2965)
* Revert change to `Server#initialize` (new) method signature from #2798

* Test changes for updated Server#intialize
2022-09-21 11:11:13 +09:00
Nate Berkopec 317e890351
Move threadpool init out of server (#2942)
* Simplify `ThreadPool` initializations code in `Puma::Server`

This commit introduces four `ThreadPool` options in `Configuration::DEFAULTS`:
`auto_trim_time`, `reaping_time`, `clean_thread_locals`, and
`out_of_band_hook` they could be configured via file/user options
`Puma::Configuration`.

The auto reap/trim methods stay in `Puma::Server` because the way we test
in `Puma::Server` tests.

Adds `slice(keys)` method to `UserFileDefaultOptions` so it acts
like a Hash and we could read `ThreadPool` options from the user-file-default options.

Adds missing require statement to `test/test_puma_server.rb`, so this test
could run individually.

Co-Authored-By: Shohei Umemoto <cafedomancer@gmail.com>
Co-Authored-By: Nate Berkopec <nate.berkopec@gmail.com>

* Fix out of band

* Fixup lib files

* Fixup tests

Co-authored-by: Juanito Fatas <me@juanitofatas.com>
Co-authored-by: Shohei Umemoto <cafedomancer@gmail.com>
Co-authored-by: MSP-Greg <Greg.mpls@gmail.com>
2022-09-15 10:25:39 +09:00
MSP-Greg 3c089fcaba
[CI] rescue more errors in teardown & wait_for_server_to_boot methods, RubyGems (#2887)
* test/helpers/integration.rb - updates for exception handling

* test/test_out_of_band_server.rb - fixup teardown

* [CI] tests.yaml - Update RubyGems for Rubies 2.3 - 2.5
2022-05-30 17:37:16 -05:00
Johnny Shields 8a4ef0c16c
[WIP] Refactor: Split out LogWriter from Events (no logic change) (#2798)
* Split out LogWriter from Events

* Improve code comment

* Fix constructor interfaces

* Fix file includes

* Fix specs and requires

* Fix LogWriter

* More fixes

* Fix tests

* Fix specs

* Fix spec

* Fix more specs

* Refactor: Split out LogWriter from Events

* Improve comments

* Fix bundle pruner

Co-authored-by: shields <shields@tablecheck.com>
2022-02-05 10:06:22 -07:00
Jacob Herrington 20dc923b0b
Extract calls to purge_interrupt_queue (#2716)
* Extract calls to purge_interrupt_queue

Move calls to Thread#purge_interrupt_queue to a module function. This
means if/when this pattern needs to change it can change in one place
instead of a dozen or more places.

* Update comment on purge_interrupt_queue [ci skip]
2021-10-01 14:11:15 -06:00
MSP-Greg c71d149117
Updates for non MRI CI stablity [changelog skip] (#2434)
* Actions non MRI - use JDK11 on macOS, add Big Sur

* Actions MRI - add macOS Big Sur Ruby 2.7

* test/helper.rb - run setup in same Timeout block as test

* TestIntegrationSingle#test_int_refuse - skip on JRuby

Seems to intermittently lockup CI

* TestLauncher#test_puma_stats - fix intermittent non-MRI failure II

* test_out_of_band_server.rb - JRuby - add small sleep after server.run

* test_persistent.rb - JRuby - add small sleep after server.run

* test_puma_server.rb - JRuby - add small sleep after server.run
2020-10-19 09:22:28 -06:00
Nate Berkopec 78b3ca7352
Revert "Consolidate option handling in Server, Server small refactors, doc changes (#2373)"
This reverts commit bbbdfb8f4c.
2020-09-28 09:12:14 -06:00
MSP-Greg bbbdfb8f4c
Consolidate option handling in Server, Server small refactors, doc changes (#2373)
* Update runner.rb

* Update server.rb

* Update test_busy_worker.rb

* Update test_out_of_band_server.rb

* Update test_persistent.rb

* Update test_puma_server.rb

* test_pumactl.rb - Fix CI warning: assigned but unused variable

* test_integration_pumactl.rb - Fix CI warning: assigned but unused variable

* Update History.md
2020-09-23 08:28:23 -06:00
MSP-Greg 712d34e46f
Test files - more port handling 2020-07-22 21:00:03 -05:00
Will Jordan 774c460e60
Improvements to out_of_band hook (#2234)
* Improve OOB hook

This moves the hook to be executed outside of busy loop
considering the thread to be truly idle at a time of execution
of the hook

* Further improvements to out-of-band hook
* Don't trigger OOB on partially-queued requests
* Don't accept new connections during OOB
* Move tests to `TestOutOfBandServer`

Co-authored-by: Kamil Trzcinski <ayufan@ayufan.eu>
Co-authored-by: Nate Berkopec <nate.berkopec@gmail.com>
2020-04-30 12:02:49 +09:00