exceptional_fork 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exceptional_fork.gemspec +2 -2
- data/lib/exceptional_fork.rb +3 -3
- data/spec/exceptional_fork_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0db67580e687ae0089a9db1b53be076642ab4f7d
|
4
|
+
data.tar.gz: 724c78595f565a34b0f9049f3cfa0a8a9b2018d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4bb138873fd2f3df438362527c2338484bef97b422640f0a2cce68879e2f99696444097b602fd73531f19ba2881b1f5e9f1631c91881085714e5920bdea1a70
|
7
|
+
data.tar.gz: d57235725c29bbf1c19133ef9ca3f6066bde036191d4f2c6e36072d8e544a240e0aeec7157715b99b2f3ec752bf3b6121dc3221e2eb99d93d47d419567f0394d
|
data/exceptional_fork.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: exceptional_fork 1.2.
|
5
|
+
# stub: exceptional_fork 1.2.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "exceptional_fork"
|
9
|
-
s.version = "1.2.
|
9
|
+
s.version = "1.2.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
data/lib/exceptional_fork.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module ExceptionalFork
|
2
|
-
VERSION = '1.2.
|
2
|
+
VERSION = '1.2.1'
|
3
3
|
QUIT = "The child process %d has quit or was killed abruptly. No error information could be retrieved".freeze
|
4
4
|
ProcessHung = Class.new(StandardError)
|
5
5
|
DEFAULT_TIMEOUT = 10
|
@@ -97,8 +97,8 @@ module ExceptionalFork
|
|
97
97
|
# be able to do other work _but_ we might be waiting indefinitely. If we use
|
98
98
|
# a non-blocking option we can supply a timeout and force-quit the process
|
99
99
|
# without using the Timeout module (and conversely having an overhead of 1
|
100
|
-
# watcher thread per child spawned)
|
101
|
-
if wait_res = Process.wait2(pid, Process::WNOHANG)
|
100
|
+
# watcher thread per child spawned).
|
101
|
+
if wait_res = Process.wait2(pid, Process::WNOHANG | Process::WUNTRACED)
|
102
102
|
_, status = wait_res
|
103
103
|
return status.exitstatus || DEFAULT_ERROR_STATUS
|
104
104
|
else
|
@@ -27,7 +27,7 @@ describe "ExceptionalFork" do
|
|
27
27
|
it "kills a process that takes too long to terminate" do
|
28
28
|
expect(Process).to receive(:fork).and_call_original
|
29
29
|
expect {
|
30
|
-
ExceptionalFork.fork_and_wait(1) { sleep
|
30
|
+
ExceptionalFork.fork_and_wait(1) { sleep 20; raise "Should never ever get here" }
|
31
31
|
}.to raise_error(ExceptionalFork::ProcessHung)
|
32
32
|
end
|
33
33
|
|