serverengine 2.2.4 → 2.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f04e7c4dc99fb0496568579a6516ac6df8bdae3d5c8927aa9586ff3fa530876d
4
- data.tar.gz: fcdc7828debe292af0950c9f3d3c8947c05733d3e338449667fe4b057e425c5b
3
+ metadata.gz: 2175217415cd5751a1bd4a8d60c5abdb64e80429e722c41e8c1e97ec02b1e22a
4
+ data.tar.gz: 63a7af53a0dc906bb962394f902d1486f7958950c9b3b9bf41206e56789d83ad
5
5
  SHA512:
6
- metadata.gz: 1dc366572a0df514840c8e5f74bacf1d801f86f402de15c125006d332e256be1239e91991ce02aaad82be9b0ec45eb0305c7792e39b1d666edb674671c533761
7
- data.tar.gz: c45dd0d66fe2c55e9cb71bdf930db49f33abcd08d14071aa5bb130d0119e1828691c2d6aab9372538c24b3d784dee767c625f7b2348cd03b525b1338970a32c3
6
+ metadata.gz: 85880cc1ec9b83e03b2cbe80756253e156e46954117ae0a008388bfccf3d412b96a54911f9f002b6387ec2dfa9ef35dd3a40bff1dff22f7b5ca180f667d88611
7
+ data.tar.gz: 624a1e6397faa39af9b871ef91571b432263d6b2b595fc4bdfaa9244a6153b25a67fe80c38c6f814c94db27b0dddcc1e4e19ae08515c8e48c2ee6208478775d0
@@ -1,26 +1,31 @@
1
1
  name: Testing on Ubuntu
2
2
  on:
3
- - push
4
- - pull_request
3
+ push:
4
+ branches: [master]
5
+ pull_request:
6
+ branches: [master]
7
+
5
8
  jobs:
6
- build:
9
+ test:
7
10
  runs-on: ${{ matrix.os }}
8
11
  strategy:
9
12
  fail-fast: false
10
13
  matrix:
11
- ruby: [ '3.0', '2.7', '2.6', '2.5' ]
14
+ ruby: [ '3.1', '3.0', '2.7', '2.6' ]
12
15
  os:
13
16
  - ubuntu-latest
14
- name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
17
+ name: Unit testing with Ruby ${{ matrix.ruby }} on ${{ matrix.os }}
15
18
  steps:
16
- - uses: actions/checkout@v2
17
- - uses: ruby/setup-ruby@v1
18
- with:
19
- ruby-version: ${{ matrix.ruby }}
20
- - name: unit testing
21
- env:
22
- CI: true
23
- run: |
24
- gem install bundler rake
25
- bundle install --jobs 4 --retry 3
26
- bundle exec rake spec
19
+ - uses: actions/checkout@v2
20
+ - name: Set up Ruby
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby }}
24
+ - name: Install dependencies
25
+ run: |
26
+ gem install bundler rake
27
+ bundle install --jobs 4 --retry 3
28
+ - name: Run tests
29
+ env:
30
+ CI: true
31
+ run: bundle exec rake spec
@@ -0,0 +1,42 @@
1
+ name: Testing on Windows
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ pull_request:
6
+ branches: [master]
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ${{ matrix.os }}
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ ruby: [ '3.1', '2.7', '2.6' ]
15
+ os:
16
+ - windows-latest
17
+ include:
18
+ - ruby: '3.0.3'
19
+ os: windows-latest
20
+ # On Ruby 3.0, we need to use fiddle 1.0.8 or later to retrieve correct
21
+ # error code. In addition, we have to specify the path of fiddle by RUBYLIB
22
+ # because RubyInstaller loads Ruby's bundled fiddle before initializing gem.
23
+ # See also:
24
+ # * https://github.com/ruby/fiddle/issues/72
25
+ # * https://bugs.ruby-lang.org/issues/17813
26
+ # * https://github.com/oneclick/rubyinstaller2/blob/8225034c22152d8195bc0aabc42a956c79d6c712/lib/ruby_installer/build/dll_directory.rb
27
+ ruby-lib-opt: RUBYLIB=%RUNNER_TOOL_CACHE%/Ruby/3.0.3/x64/lib/ruby/gems/3.0.0/gems/fiddle-1.1.0/lib
28
+
29
+ name: Unit testing with Ruby ${{ matrix.ruby }} on ${{ matrix.os }}
30
+ steps:
31
+ - uses: actions/checkout@v2
32
+ - name: Set up Ruby
33
+ uses: ruby/setup-ruby@v1
34
+ with:
35
+ ruby-version: ${{ matrix.ruby }}
36
+ - name: Add Fiddle 1.1.0
37
+ if: ${{ matrix.ruby == '3.0.3' }}
38
+ run: gem install fiddle --version 1.1.0
39
+ - name: Install dependencies
40
+ run: ridk exec bundle install --jobs 4 --retry 3
41
+ - name: Run tests
42
+ run: bundle exec rake spec ${{ matrix.ruby-lib-opt }}
data/Changelog CHANGED
@@ -1,3 +1,7 @@
1
+ 2022-01-13 version 2.2.5:
2
+
3
+ * Fix DLL load error on Ruby 3.1 on Windows
4
+
1
5
  2021-05-24 version 2.2.4:
2
6
 
3
7
  * Ensure to get correct Win32 socket error on Ruby 3.0
@@ -142,7 +142,11 @@ module ServerEngine
142
142
  return false unless @pmon
143
143
 
144
144
  if stat = @pmon.try_join
145
- @worker.logger.info "Worker #{@wid} finished#{@stop ? '' : ' unexpectedly'} with #{ServerEngine.format_join_status(stat)}"
145
+ if @stop
146
+ @worker.logger.info "Worker #{@wid} finished with #{ServerEngine.format_join_status(stat)}"
147
+ else
148
+ @worker.logger.error "Worker #{@wid} finished unexpectedly with #{ServerEngine.format_join_status(stat)}"
149
+ end
146
150
  if stat.is_a?(Process::Status) && stat.exited? && @unrecoverable_exit_codes.include?(stat.exitstatus)
147
151
  @unrecoverable_exit = true
148
152
  @exitstatus = stat.exitstatus
@@ -1,3 +1,3 @@
1
1
  module ServerEngine
2
- VERSION = "2.2.4"
2
+ VERSION = "2.2.5"
3
3
  end
@@ -21,6 +21,7 @@ module ServerEngine
21
21
  require 'fiddle/import'
22
22
  require 'fiddle/types'
23
23
  require 'socket'
24
+ require 'rbconfig'
24
25
 
25
26
  extend Fiddle::Importer
26
27
 
@@ -101,14 +102,7 @@ module ServerEngine
101
102
  extern "int GetModuleFileNameA(int, char *, int)"
102
103
  extern "int CloseHandle(int)"
103
104
 
104
- ruby_bin_path_buf = Fiddle::Pointer.malloc(1000)
105
- GetModuleFileNameA(0, ruby_bin_path_buf, ruby_bin_path_buf.size)
106
-
107
- ruby_bin_path = ruby_bin_path_buf.to_s.gsub(/\\/, '/')
108
- ruby_dll_paths = File.dirname(ruby_bin_path) + '/*msvcr*ruby*.dll'
109
- ruby_dll_path = Dir.glob(ruby_dll_paths).first
110
- dlload ruby_dll_path
111
-
105
+ dlload RbConfig::CONFIG['LIBRUBY_SO']
112
106
  extern "int rb_w32_map_errno(int)"
113
107
 
114
108
  def self.raise_last_error(name)
@@ -197,7 +197,13 @@ describe ServerEngine::Supervisor do
197
197
  t.join
198
198
  end
199
199
 
200
- test_state(:worker_run).should == 3
200
+ if ServerEngine.windows?
201
+ # Because launching a process on Windows is high cost,
202
+ # it doesn't often reach to 3.
203
+ test_state(:worker_run).should <= 3
204
+ else
205
+ test_state(:worker_run).should == 3
206
+ end
201
207
  end
202
208
  end
203
209
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverengine
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.4
4
+ version: 2.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-24 00:00:00.000000000 Z
11
+ date: 2022-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sigdump
@@ -88,6 +88,7 @@ extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
90
  - ".github/workflows/linux.yml"
91
+ - ".github/workflows/windows.yml"
91
92
  - ".gitignore"
92
93
  - ".rspec"
93
94
  - Changelog
@@ -96,7 +97,6 @@ files:
96
97
  - NOTICE
97
98
  - README.md
98
99
  - Rakefile
99
- - appveyor.yml
100
100
  - examples/server.rb
101
101
  - examples/spawn_worker_script.rb
102
102
  - lib/serverengine.rb
data/appveyor.yml DELETED
@@ -1,35 +0,0 @@
1
- ---
2
- image: Visual Studio 2019
3
-
4
- install:
5
- - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
6
- - ruby --version
7
- - gem --version
8
- - bundle install
9
- build: off
10
- test_script:
11
- - bundle exec rake spec
12
-
13
- environment:
14
- matrix:
15
- - ruby_version: "30-x64"
16
- - ruby_version: "27-x64"
17
- - ruby_version: "26-x64"
18
- - ruby_version: "25-x64"
19
-
20
- # On Ruby 3.0, we need to use fiddle 1.0.8 or later to retrieve correct
21
- # error code. In addition, we have to specify the path of fiddle by RUBYLIB
22
- # because RubyInstaller loads Ruby's bundled fiddle before initializing gem.
23
- # See also:
24
- # * https://github.com/ruby/fiddle/issues/72
25
- # * https://bugs.ruby-lang.org/issues/17813
26
- # * https://github.com/oneclick/rubyinstaller2/blob/8225034c22152d8195bc0aabc42a956c79d6c712/lib/ruby_installer/build/dll_directory.rb
27
- for:
28
- -
29
- matrix:
30
- only:
31
- - ruby_version: "30-x64"
32
- test_script:
33
- - gem install fiddle --version 1.0.8
34
- - set RUBYLIB=C:/Ruby%ruby_version%/lib/ruby/gems/3.0.0/gems/fiddle-1.0.8/lib
35
- - bundle exec rake spec