passenger 4.0.45 → 4.0.46

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (94) hide show
  1. checksums.yaml +8 -8
  2. checksums.yaml.gz.asc +7 -7
  3. data.tar.gz.asc +7 -7
  4. data/.editorconfig +19 -0
  5. data/CHANGELOG +47 -0
  6. data/CONTRIBUTING.md +9 -1
  7. data/CONTRIBUTORS +4 -0
  8. data/Vagrantfile +7 -3
  9. data/build/agents.rb +1 -0
  10. data/build/misc.rb +6 -4
  11. data/dev/vagrant/bashrc +2 -0
  12. data/doc/Design and Architecture.txt +9 -7
  13. data/doc/Users guide Apache.idmap.txt +2 -0
  14. data/doc/Users guide Apache.txt +24 -4
  15. data/doc/Users guide Nginx.idmap.txt +4 -0
  16. data/doc/Users guide Nginx.txt +23 -4
  17. data/doc/images/code_walkthrough.jpg +0 -0
  18. data/doc/users_guide_snippets/installation.txt +38 -0
  19. data/ext/common/AgentsStarter.h +6 -1
  20. data/ext/common/ApplicationPool2/Common.h +17 -2
  21. data/ext/common/ApplicationPool2/DirectSpawner.h +5 -11
  22. data/ext/common/ApplicationPool2/DummySpawner.h +2 -4
  23. data/ext/common/ApplicationPool2/ErrorRenderer.h +119 -0
  24. data/ext/common/ApplicationPool2/Implementation.cpp +159 -11
  25. data/ext/common/ApplicationPool2/Options.h +16 -7
  26. data/ext/common/ApplicationPool2/Pool.h +28 -24
  27. data/ext/common/ApplicationPool2/Process.h +1 -9
  28. data/ext/common/ApplicationPool2/SmartSpawner.h +15 -18
  29. data/ext/common/ApplicationPool2/Spawner.h +18 -14
  30. data/ext/common/ApplicationPool2/SpawnerFactory.h +12 -30
  31. data/ext/common/Constants.h +1 -1
  32. data/ext/common/Exceptions.h +15 -2
  33. data/ext/common/UnionStation/Core.h +9 -0
  34. data/ext/common/Utils/JsonUtils.h +53 -0
  35. data/ext/common/Utils/ProcessMetricsCollector.h +1 -1
  36. data/ext/common/Utils/SpeedMeter.h +7 -3
  37. data/ext/common/Utils/SystemMetricsCollector.h +8 -6
  38. data/ext/common/agents/HelperAgent/Main.cpp +4 -4
  39. data/ext/common/agents/HelperAgent/RequestHandler.h +115 -56
  40. data/ext/nginx/ConfigurationCommands.c +1 -1
  41. data/ext/nginx/ConfigurationCommands.c.erb +6 -1
  42. data/ext/nginx/ContentHandler.c +2 -1
  43. data/ext/nginx/config +1 -1
  44. data/helper-scripts/node-loader.js +23 -0
  45. data/helper-scripts/wsgi-loader.py +12 -4
  46. data/lib/phusion_passenger.rb +1 -1
  47. data/lib/phusion_passenger/active_support3_extensions/init.rb +39 -78
  48. data/lib/phusion_passenger/constants.rb +3 -1
  49. data/lib/phusion_passenger/loader_shared_helpers.rb +10 -5
  50. data/lib/phusion_passenger/nginx/config_options.rb +3 -1
  51. data/lib/phusion_passenger/packaging.rb +1 -0
  52. data/lib/phusion_passenger/public_api.rb +108 -16
  53. data/lib/phusion_passenger/rack/thread_handler_extension.rb +1 -0
  54. data/lib/phusion_passenger/request_handler.rb +2 -2
  55. data/lib/phusion_passenger/request_handler/thread_handler.rb +28 -46
  56. data/lib/phusion_passenger/standalone/command.rb +8 -1
  57. data/lib/phusion_passenger/standalone/main.rb +0 -1
  58. data/lib/phusion_passenger/standalone/start_command.rb +4 -0
  59. data/lib/phusion_passenger/union_station/connection.rb +67 -0
  60. data/lib/phusion_passenger/{analytics_logger.rb → union_station/core.rb} +55 -256
  61. data/lib/phusion_passenger/union_station/transaction.rb +168 -0
  62. data/lib/phusion_passenger/utils.rb +4 -0
  63. data/lib/phusion_passenger/utils/lock.rb +62 -0
  64. data/resources/mime.types +1 -0
  65. data/resources/templates/error_layout.html.template +2 -0
  66. data/resources/templates/standalone/config.erb +1 -0
  67. data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +5 -3
  68. data/test/cxx/ApplicationPool2/PoolTest.cpp +13 -3
  69. data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +16 -13
  70. data/test/cxx/ApplicationPool2/SpawnerTestCases.cpp +6 -0
  71. data/test/cxx/FileBackedPipeTest.cpp +1 -1
  72. data/test/cxx/RequestHandlerTest.cpp +158 -2
  73. data/test/cxx/ServerInstanceDirTest.cpp +2 -0
  74. data/test/cxx/TestSupport.h +21 -2
  75. data/test/cxx/UtilsTest.cpp +1 -0
  76. data/test/ruby/classic_rails/loader_spec.rb +0 -1
  77. data/test/ruby/classic_rails/preloader_spec.rb +0 -1
  78. data/test/ruby/rails3.0/loader_spec.rb +2 -2
  79. data/test/ruby/rails3.0/preloader_spec.rb +2 -2
  80. data/test/ruby/rails3.1/loader_spec.rb +2 -2
  81. data/test/ruby/rails3.1/preloader_spec.rb +2 -2
  82. data/test/ruby/rails3.2/loader_spec.rb +2 -2
  83. data/test/ruby/rails3.2/preloader_spec.rb +2 -2
  84. data/test/ruby/rails4.0/loader_spec.rb +2 -2
  85. data/test/ruby/rails4.0/preloader_spec.rb +2 -2
  86. data/test/ruby/request_handler_spec.rb +8 -8
  87. data/test/ruby/shared/rails/{analytics_logging_extensions_sharedspec.rb → union_station_extensions_sharedspec.rb} +5 -4
  88. data/test/ruby/union_station_spec.rb +283 -0
  89. data/test/stub/wsgi/passenger_wsgi.py +41 -5
  90. metadata +12 -7
  91. metadata.gz.asc +7 -7
  92. data/helper-scripts/wsgi-preloader.py +0 -1
  93. data/lib/phusion_passenger/standalone/package_runtime_command.rb +0 -105
  94. data/test/ruby/analytics_logger_spec.rb +0 -283
@@ -0,0 +1,168 @@
1
+ # Phusion Passenger - https://www.phusionpassenger.com/
2
+ # Copyright (c) 2010-2014 Phusion
3
+ #
4
+ # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the "Software"), to deal
8
+ # in the Software without restriction, including without limitation the rights
9
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ # copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in
14
+ # all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ # THE SOFTWARE.
23
+
24
+ PhusionPassenger.require_passenger_lib 'debug_logging'
25
+ PhusionPassenger.require_passenger_lib 'union_station/core'
26
+ PhusionPassenger.require_passenger_lib 'utils/native_support_utils'
27
+
28
+ module PhusionPassenger
29
+ module UnionStation
30
+
31
+ class Transaction
32
+ include DebugLogging
33
+
34
+ attr_reader :txn_id
35
+
36
+ def initialize(connection = nil, txn_id = nil)
37
+ if connection
38
+ @connection = connection
39
+ @txn_id = txn_id
40
+ connection.ref
41
+ end
42
+ end
43
+
44
+ def null?
45
+ return !@connection || !@connection.connected?
46
+ end
47
+
48
+ def message(text)
49
+ if !@connection
50
+ timestamp_string = Core.timestamp_string
51
+ trace(3, "[Union Station log to null] #{@txn_id} #{timestamp_string} #{text}")
52
+ return
53
+ end
54
+ @connection.synchronize do
55
+ return if !@connection.connected?
56
+ begin
57
+ timestamp_string = Core.timestamp_string
58
+ trace(3, "[Union Station log] #{@txn_id} #{timestamp_string} #{text}")
59
+ @connection.channel.write("log", @txn_id, timestamp_string)
60
+ @connection.channel.write_scalar(text)
61
+ rescue SystemCallError, IOError => e
62
+ @connection.disconnect
63
+ warn("Error communicating with the logging agent: #{e.message}")
64
+ rescue Exception => e
65
+ @connection.disconnect
66
+ raise e
67
+ end
68
+ end
69
+ end
70
+
71
+ def begin_measure(name, extra_info = nil)
72
+ if extra_info
73
+ extra_info_base64 = [extra_info].pack("m")
74
+ extra_info_base64.gsub!("\n", "")
75
+ extra_info_base64.strip!
76
+ else
77
+ extra_info_base64 = nil
78
+ end
79
+ times = Utils::NativeSupportUtils.process_times
80
+ message "BEGIN: #{name} (#{current_timestamp.to_s(36)},#{times.utime.to_s(36)},#{times.stime.to_s(36)}) #{extra_info_base64}"
81
+ end
82
+
83
+ def end_measure(name, error_encountered = false)
84
+ times = Utils::NativeSupportUtils.process_times
85
+ if error_encountered
86
+ message "FAIL: #{name} (#{current_timestamp.to_s(36)},#{times.utime.to_s(36)},#{times.stime.to_s(36)})"
87
+ else
88
+ message "END: #{name} (#{current_timestamp.to_s(36)},#{times.utime.to_s(36)},#{times.stime.to_s(36)})"
89
+ end
90
+ end
91
+
92
+ def measure(name, extra_info = nil)
93
+ begin_measure(name, extra_info)
94
+ begin
95
+ yield
96
+ rescue Exception
97
+ error = true
98
+ is_closed = closed?
99
+ raise
100
+ ensure
101
+ end_measure(name, error) if !is_closed
102
+ end
103
+ end
104
+
105
+ def measured_time_points(name, begin_time, end_time, extra_info = nil)
106
+ if extra_info
107
+ extra_info_base64 = [extra_info].pack("m")
108
+ extra_info_base64.gsub!("\n", "")
109
+ extra_info_base64.strip!
110
+ else
111
+ extra_info_base64 = nil
112
+ end
113
+ begin_timestamp = begin_time.to_i * 1_000_000 + begin_time.usec
114
+ end_timestamp = end_time.to_i * 1_000_000 + end_time.usec
115
+ message "BEGIN: #{name} (#{begin_timestamp.to_s(36)}) #{extra_info_base64}"
116
+ message "END: #{name} (#{end_timestamp.to_s(36)})"
117
+ end
118
+
119
+ def close(flush_to_disk = false)
120
+ @connection.synchronize do
121
+ return if !@connection.connected?
122
+ begin
123
+ # We need an ACK here. See thread_handler.rb finalize_request.
124
+ @connection.channel.write("closeTransaction", @txn_id,
125
+ Core.timestamp_string, true)
126
+ result = @connection.channel.read
127
+ if result != ["ok"]
128
+ raise "Expected logging agent to respond with 'ok', but got #{result.inspect} instead"
129
+ end
130
+ if flush_to_disk
131
+ @connection.channel.write("flush")
132
+ result = @connection.channel.read
133
+ if result != ["ok"]
134
+ raise "Invalid logging agent response #{result.inspect} to the 'flush' command"
135
+ end
136
+ end
137
+ rescue SystemCallError, IOError => e
138
+ @connection.disconnect
139
+ warn("Error communicating with the logging agent: #{e.message}")
140
+ rescue Exception => e
141
+ @connection.disconnect
142
+ raise e
143
+ ensure
144
+ @connection.unref
145
+ @connection = nil
146
+ end
147
+ end if @connection
148
+ end
149
+
150
+ def closed?
151
+ if @connection
152
+ @connection.synchronize do
153
+ return !@connection.connected?
154
+ end
155
+ else
156
+ return nil
157
+ end
158
+ end
159
+
160
+ private
161
+ def current_timestamp
162
+ time = Core.current_time
163
+ return time.to_i * 1_000_000 + time.usec
164
+ end
165
+ end
166
+
167
+ end # module UnionStation
168
+ end # module PhusionPassenger
@@ -57,6 +57,10 @@ module Utils
57
57
  end
58
58
  end
59
59
 
60
+ def home_dir
61
+ Etc.getpwuid(Process.uid).dir
62
+ end
63
+
60
64
  # Print the given exception, including the stack trace, to STDERR.
61
65
  #
62
66
  # +current_location+ is a string which describes where the code is
@@ -0,0 +1,62 @@
1
+ # Phusion Passenger - https://www.phusionpassenger.com/
2
+ # Copyright (c) 2010-2014 Phusion
3
+ #
4
+ # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the "Software"), to deal
8
+ # in the Software without restriction, including without limitation the rights
9
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ # copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in
14
+ # all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ # THE SOFTWARE.
23
+
24
+ module PhusionPassenger
25
+ module Utils
26
+
27
+ class Lock
28
+ def initialize(mutex)
29
+ @mutex = mutex
30
+ @locked = false
31
+ end
32
+
33
+ def reset(mutex, lock_now = true)
34
+ unlock if @locked
35
+ @mutex = mutex
36
+ lock if lock_now
37
+ end
38
+
39
+ def synchronize
40
+ lock if !@locked
41
+ begin
42
+ yield(self)
43
+ ensure
44
+ unlock if @locked
45
+ end
46
+ end
47
+
48
+ def lock
49
+ raise if @locked
50
+ @mutex.lock
51
+ @locked = true
52
+ end
53
+
54
+ def unlock
55
+ raise if !@locked
56
+ @mutex.unlock
57
+ @locked = false
58
+ end
59
+ end
60
+
61
+ end # module Utils
62
+ end # module PhusionPassenger
@@ -53,6 +53,7 @@ types {
53
53
  application/x-shockwave-flash swf;
54
54
  application/x-stuffit sit;
55
55
  application/x-tcl tcl tk;
56
+ application/x-web-app-manifest+json webapp;
56
57
  application/x-x509-ca-cert der pem crt;
57
58
  application/x-xpinstall xpi;
58
59
  application/zip zip;
@@ -34,6 +34,8 @@
34
34
  {{CONTENT|raw}}
35
35
 
36
36
  <dl>
37
+ <dt>Error ID</dt>
38
+ <dd>{{ERROR_ID}}</dd>
37
39
  <dt>Application root</dt>
38
40
  <dd>{{APP_ROOT}}</dd>
39
41
  <dt>Environment (value of RAILS_ENV, RACK_ENV, WSGI_ENV, NODE_ENV and PASSENGER_APP_ENV)</dt>
@@ -61,6 +61,7 @@ http {
61
61
  <% if @options[:temp_dir] %>passenger_temp_dir '<%= @options[:temp_dir] %>';<% end %>
62
62
  <% if @options[:rolling_restarts] %>passenger_rolling_restarts on;<% end %>
63
63
  <% if @options[:resist_deployment_errors] %>passenger_resist_deployment_errors on;<% end %>
64
+ <% if !@options[:load_shell_envvars] %>passenger_load_shell_envvars off;<% end %>
64
65
 
65
66
  <% if !@options[:friendly_error_pages].nil? -%>
66
67
  passenger_friendly_error_pages <%= boolean_config_value(@options[:friendly_error_pages]) %>;
@@ -32,7 +32,7 @@ namespace tut {
32
32
 
33
33
  boost::shared_ptr<DirectSpawner> createSpawner(const Options &options) {
34
34
  return boost::make_shared<DirectSpawner>(
35
- *resourceLocator, generation);
35
+ generation, make_shared<SpawnerConfig>(*resourceLocator));
36
36
  }
37
37
 
38
38
  Options createOptions() {
@@ -62,7 +62,8 @@ namespace tut {
62
62
  options.startupFile = ".";
63
63
  options.startTimeout = 300;
64
64
 
65
- DirectSpawner spawner(*resourceLocator, generation);
65
+ DirectSpawner spawner(generation, make_shared<SpawnerConfig>(*resourceLocator));
66
+ setLogLevel(LVL_CRIT);
66
67
 
67
68
  try {
68
69
  process = spawner.spawn(options);
@@ -84,7 +85,8 @@ namespace tut {
84
85
  options.startCommand = "perl\t" "-e\t" "print STDERR \"hello world\\n\"";
85
86
  options.startupFile = ".";
86
87
 
87
- DirectSpawner spawner(*resourceLocator, generation);
88
+ DirectSpawner spawner(generation, make_shared<SpawnerConfig>(*resourceLocator));
89
+ setLogLevel(LVL_CRIT);
88
90
 
89
91
  try {
90
92
  process = spawner.spawn(options);
@@ -33,9 +33,9 @@ namespace tut {
33
33
  ApplicationPool2_PoolTest() {
34
34
  createServerInstanceDirAndGeneration(serverInstanceDir, generation);
35
35
  retainSessions = false;
36
- spawnerConfig = boost::make_shared<SpawnerConfig>();
37
- spawnerFactory = boost::make_shared<SpawnerFactory>(*resourceLocator,
38
- generation, spawnerConfig);
36
+ spawnerConfig = boost::make_shared<SpawnerConfig>(*resourceLocator);
37
+ spawnerFactory = boost::make_shared<SpawnerFactory>(generation,
38
+ spawnerConfig);
39
39
  pool = boost::make_shared<Pool>(spawnerFactory);
40
40
  pool->initialize();
41
41
  callback = boost::bind(&ApplicationPool2_PoolTest::_callback, this, _1, _2);
@@ -636,6 +636,7 @@ namespace tut {
636
636
  Options options = createOptions();
637
637
  options.appRoot = "tmp.wsgi";
638
638
  options.appType = "wsgi";
639
+ options.startupFile = "passenger_wsgi.py";
639
640
  options.spawnMethod = "direct";
640
641
  options.minProcesses = 0;
641
642
  initPoolDebugging();
@@ -781,6 +782,7 @@ namespace tut {
781
782
  // Create a group tmp.wsgi.
782
783
  options1.appRoot = "tmp.wsgi";
783
784
  options1.appType = "wsgi";
785
+ options1.startupFile = "passenger_wsgi.py";
784
786
  options1.spawnMethod = "direct";
785
787
  SystemTime::force(1);
786
788
  session = pool->get(options1, &ticket);
@@ -1470,6 +1472,7 @@ namespace tut {
1470
1472
  Options options = createOptions();
1471
1473
  options.appRoot = "tmp.wsgi";
1472
1474
  options.appType = "wsgi";
1475
+ options.startupFile = "passenger_wsgi.py";
1473
1476
  options.spawnMethod = "direct";
1474
1477
  pool->setMax(1);
1475
1478
 
@@ -1505,6 +1508,7 @@ namespace tut {
1505
1508
  Options options = createOptions();
1506
1509
  options.appRoot = "tmp.wsgi";
1507
1510
  options.appType = "wsgi";
1511
+ options.startupFile = "passenger_wsgi.py";
1508
1512
  options.spawnMethod = "direct";
1509
1513
 
1510
1514
  writeFile("tmp.wsgi/passenger_wsgi.py",
@@ -1529,6 +1533,7 @@ namespace tut {
1529
1533
  Options options = createOptions();
1530
1534
  options.appRoot = "tmp.wsgi";
1531
1535
  options.appType = "wsgi";
1536
+ options.startupFile = "passenger_wsgi.py";
1532
1537
  options.spawnMethod = "direct";
1533
1538
  options.minProcesses = 4;
1534
1539
 
@@ -1571,6 +1576,7 @@ namespace tut {
1571
1576
  Options options = createOptions();
1572
1577
  options.appRoot = "stub/wsgi";
1573
1578
  options.appType = "wsgi";
1579
+ options.startupFile = "passenger_wsgi.py";
1574
1580
  options.spawnMethod = "direct";
1575
1581
 
1576
1582
  pool->asyncGet(options, callback);
@@ -1733,6 +1739,7 @@ namespace tut {
1733
1739
  Options options = createOptions();
1734
1740
  options.appRoot = "tmp.wsgi";
1735
1741
  options.appType = "wsgi";
1742
+ options.startupFile = "passenger_wsgi.py";
1736
1743
  options.spawnMethod = "direct";
1737
1744
  pool->setMax(1);
1738
1745
 
@@ -1782,6 +1789,7 @@ namespace tut {
1782
1789
  Options options = createOptions();
1783
1790
  options.appRoot = "tmp.wsgi";
1784
1791
  options.appType = "wsgi";
1792
+ options.startupFile = "passenger_wsgi.py";
1785
1793
  options.spawnMethod = "direct";
1786
1794
  options.minProcesses = 2;
1787
1795
 
@@ -1815,6 +1823,7 @@ namespace tut {
1815
1823
  Options options = createOptions();
1816
1824
  options.appRoot = "tmp.wsgi";
1817
1825
  options.appType = "wsgi";
1826
+ options.startupFile = "passenger_wsgi.py";
1818
1827
  options.spawnMethod = "direct";
1819
1828
  options.maxOutOfBandWorkInstances = 2;
1820
1829
  initPoolDebugging();
@@ -1974,6 +1983,7 @@ namespace tut {
1974
1983
  Options options = createOptions();
1975
1984
  options.appRoot = "tmp.wsgi";
1976
1985
  options.appType = "wsgi";
1986
+ options.startupFile = "passenger_wsgi.py";
1977
1987
  options.spawnMethod = "direct";
1978
1988
 
1979
1989
  SessionPtr session = pool->get(options, &ticket);
@@ -47,10 +47,10 @@ namespace tut {
47
47
  }
48
48
 
49
49
  return boost::make_shared<SmartSpawner>(
50
- *resourceLocator,
51
50
  generation,
52
51
  command,
53
- options);
52
+ options,
53
+ make_shared<SpawnerConfig>(*resourceLocator));
54
54
  }
55
55
 
56
56
  Options createOptions() {
@@ -78,6 +78,7 @@ namespace tut {
78
78
  options.startCommand = "ruby\t" "start.rb";
79
79
  options.startupFile = "start.rb";
80
80
  boost::shared_ptr<SmartSpawner> spawner = createSpawner(options);
81
+ setLogLevel(LVL_CRIT);
81
82
  process = spawner->spawn(options);
82
83
  process->requiresShutdown = false;
83
84
 
@@ -86,7 +87,6 @@ namespace tut {
86
87
  usleep(300000);
87
88
 
88
89
  // No exception at next spawn.
89
- setLogLevel(-1);
90
90
  process = spawner->spawn(options);
91
91
  process->requiresShutdown = false;
92
92
  }
@@ -98,7 +98,7 @@ namespace tut {
98
98
  options.appRoot = "stub/rack";
99
99
  options.startCommand = "ruby\t" "start.rb";
100
100
  options.startupFile = "start.rb";
101
- setLogLevel(-1);
101
+ setLogLevel(LVL_CRIT);
102
102
  boost::shared_ptr<SmartSpawner> spawner = createSpawner(options, true);
103
103
  try {
104
104
  process = spawner->spawn(options);
@@ -124,10 +124,11 @@ namespace tut {
124
124
  preloaderCommand.push_back("-c");
125
125
  preloaderCommand.push_back("echo hello world >&2; sleep 60");
126
126
  SmartSpawner spawner(
127
- *resourceLocator,
128
127
  generation,
129
128
  preloaderCommand,
130
- options);
129
+ options,
130
+ make_shared<SpawnerConfig>(*resourceLocator));
131
+ setLogLevel(LVL_CRIT);
131
132
 
132
133
  try {
133
134
  process = spawner.spawn(options);
@@ -154,11 +155,12 @@ namespace tut {
154
155
  preloaderCommand.push_back("-c");
155
156
  preloaderCommand.push_back("echo hello world >&2");
156
157
  SmartSpawner spawner(
157
- *resourceLocator,
158
158
  generation,
159
159
  preloaderCommand,
160
- options);
161
-
160
+ options,
161
+ make_shared<SpawnerConfig>(*resourceLocator));
162
+ setLogLevel(LVL_CRIT);
163
+
162
164
  try {
163
165
  process = spawner.spawn(options);
164
166
  process->requiresShutdown = false;
@@ -184,10 +186,11 @@ namespace tut {
184
186
  preloaderCommand.push_back("-c");
185
187
  preloaderCommand.push_back("echo hello world >&2");
186
188
  SmartSpawner spawner(
187
- *resourceLocator,
188
189
  generation,
189
190
  preloaderCommand,
190
- options);
191
+ options,
192
+ make_shared<SpawnerConfig>(*resourceLocator));
193
+ setLogLevel(LVL_CRIT);
191
194
 
192
195
  try {
193
196
  process = spawner.spawn(options);
@@ -211,10 +214,10 @@ namespace tut {
211
214
  preloaderCommand.push_back("ruby");
212
215
  preloaderCommand.push_back(resourceLocator->getHelperScriptsDir() + "/rack-preloader.rb");
213
216
  SmartSpawner spawner(
214
- *resourceLocator,
215
217
  generation,
216
218
  preloaderCommand,
217
- options);
219
+ options,
220
+ make_shared<SpawnerConfig>(*resourceLocator));
218
221
  process = spawner.spawn(options);
219
222
  process->requiresShutdown = false;
220
223
  }