passenger 5.0.25 → 5.0.26

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 (128) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +20 -0
  3. data/CONTRIBUTORS +1 -0
  4. data/build/cxx_dependency_map.rb +7338 -7104
  5. data/build/cxx_tests.rb +3 -3
  6. data/build/misc.rb +1 -0
  7. data/dev/index_cxx_dependencies.rb +3 -2
  8. data/resources/templates/standalone/config.erb +1 -1
  9. data/resources/templates/standalone/http.erb +1 -0
  10. data/resources/templates/standalone/server.erb +1 -0
  11. data/src/agent/Core/ApplicationPool/AbstractSession.h +83 -0
  12. data/src/agent/Core/ApplicationPool/Common.h +6 -4
  13. data/src/agent/Core/ApplicationPool/Options.h +4 -1
  14. data/src/agent/Core/ApplicationPool/Pool.h +2 -2
  15. data/src/agent/Core/ApplicationPool/Pool/AnalyticsCollection.cpp +3 -6
  16. data/src/agent/Core/ApplicationPool/Pool/GeneralUtils.cpp +3 -3
  17. data/src/agent/Core/ApplicationPool/Session.h +15 -27
  18. data/src/agent/Core/ApplicationPool/TestSession.h +188 -0
  19. data/src/agent/Core/Controller.h +15 -6
  20. data/src/agent/Core/Controller/CheckoutSession.cpp +13 -5
  21. data/src/agent/Core/Controller/ForwardResponse.cpp +20 -2
  22. data/src/agent/Core/Controller/Hooks.cpp +15 -2
  23. data/src/agent/Core/Controller/InitRequest.cpp +5 -1
  24. data/src/agent/Core/Controller/InitializationAndShutdown.cpp +1 -0
  25. data/src/agent/Core/Controller/Request.h +11 -4
  26. data/src/agent/Core/Controller/SendRequest.cpp +34 -13
  27. data/src/agent/Core/Controller/StateInspectionAndConfiguration.cpp +2 -2
  28. data/src/agent/Core/CoreMain.cpp +27 -1
  29. data/src/agent/Core/OptionParser.h +11 -1
  30. data/src/agent/Core/SpawningKit/DirectSpawner.h +1 -0
  31. data/src/agent/Core/SpawningKit/SmartSpawner.h +1 -0
  32. data/src/agent/Core/SpawningKit/Spawner.h +21 -1
  33. data/src/agent/SpawnPreparer/SpawnPreparerMain.cpp +1 -1
  34. data/src/agent/UstRouter/OptionParser.h +7 -1
  35. data/src/agent/UstRouter/UstRouterMain.cpp +27 -1
  36. data/src/cxx_supportlib/Algorithms/MovingAverage.h +223 -0
  37. data/src/cxx_supportlib/Constants.h +2 -2
  38. data/src/cxx_supportlib/DataStructures/StringKeyTable.h +96 -40
  39. data/src/cxx_supportlib/ResourceLocator.h +33 -14
  40. data/src/cxx_supportlib/ServerKit/Channel.h +198 -69
  41. data/src/cxx_supportlib/ServerKit/Errors.h +6 -1
  42. data/src/cxx_supportlib/ServerKit/HttpRequest.h +20 -1
  43. data/src/cxx_supportlib/ServerKit/HttpServer.h +124 -32
  44. data/src/cxx_supportlib/ServerKit/Server.h +65 -1
  45. data/src/cxx_supportlib/Utils/IOUtils.cpp +12 -22
  46. data/src/cxx_supportlib/Utils/JsonUtils.h +87 -1
  47. data/src/cxx_supportlib/Utils/StrIntUtils.cpp +16 -1
  48. data/src/cxx_supportlib/Utils/StrIntUtils.h +31 -1
  49. data/src/cxx_supportlib/Utils/VariantMap.h +6 -1
  50. data/src/cxx_supportlib/WatchdogLauncher.h +17 -9
  51. data/src/cxx_supportlib/vendor-copy/libuv/AUTHORS +43 -0
  52. data/src/cxx_supportlib/vendor-copy/libuv/ChangeLog +350 -1
  53. data/src/cxx_supportlib/vendor-copy/libuv/Makefile.am +9 -1
  54. data/src/cxx_supportlib/vendor-copy/libuv/README.md +48 -0
  55. data/src/cxx_supportlib/vendor-copy/libuv/checksparse.sh +1 -0
  56. data/src/cxx_supportlib/vendor-copy/libuv/common.gypi +5 -5
  57. data/src/cxx_supportlib/vendor-copy/libuv/configure.ac +2 -1
  58. data/src/cxx_supportlib/vendor-copy/libuv/gyp_uv.py +0 -3
  59. data/src/cxx_supportlib/vendor-copy/libuv/include/uv-version.h +5 -1
  60. data/src/cxx_supportlib/vendor-copy/libuv/include/uv.h +30 -3
  61. data/src/cxx_supportlib/vendor-copy/libuv/src/fs-poll.c +3 -3
  62. data/src/cxx_supportlib/vendor-copy/libuv/src/inet.c +0 -4
  63. data/src/cxx_supportlib/vendor-copy/libuv/src/queue.h +17 -1
  64. data/src/cxx_supportlib/vendor-copy/libuv/src/threadpool.c +10 -10
  65. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/aix.c +84 -166
  66. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/android-ifaddrs.c +11 -11
  67. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/async.c +7 -1
  68. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/atomic-ops.h +17 -0
  69. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/core.c +140 -21
  70. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin.c +15 -11
  71. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/dl.c +4 -7
  72. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/freebsd.c +52 -37
  73. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/fs.c +181 -60
  74. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/fsevents.c +39 -34
  75. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/getaddrinfo.c +4 -4
  76. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/internal.h +3 -1
  77. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/kqueue.c +12 -4
  78. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-core.c +38 -15
  79. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-inotify.c +36 -8
  80. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-syscalls.c +4 -4
  81. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-syscalls.h +2 -2
  82. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/loop-watcher.c +6 -1
  83. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/loop.c +28 -8
  84. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/netbsd.c +18 -16
  85. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/openbsd.c +18 -16
  86. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/pipe.c +3 -3
  87. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/process.c +18 -6
  88. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/proctitle.c +2 -2
  89. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/pthread-fixes.c +1 -0
  90. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/signal.c +2 -0
  91. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/stream.c +47 -30
  92. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/sunos.c +13 -11
  93. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/tcp.c +43 -8
  94. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/thread.c +21 -15
  95. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/tty.c +16 -2
  96. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/udp.c +54 -14
  97. data/src/cxx_supportlib/vendor-copy/libuv/src/uv-common.c +104 -21
  98. data/src/cxx_supportlib/vendor-copy/libuv/src/uv-common.h +14 -1
  99. data/src/cxx_supportlib/vendor-copy/libuv/src/version.c +1 -5
  100. data/src/cxx_supportlib/vendor-copy/libuv/uv.gyp +22 -1
  101. data/src/nginx_module/CacheLocationConfig.c +52 -0
  102. data/src/nginx_module/CacheLocationConfig.c.erb +13 -1
  103. data/src/nginx_module/Configuration.c +1 -0
  104. data/src/nginx_module/Configuration.h +1 -0
  105. data/src/nginx_module/ConfigurationCommands.c +20 -0
  106. data/src/nginx_module/ConfigurationFields.h +4 -0
  107. data/src/nginx_module/CreateLocationConfig.c +8 -0
  108. data/src/nginx_module/MergeLocationConfig.c +12 -0
  109. data/src/nginx_module/config +31 -13
  110. data/src/nginx_module/ngx_http_passenger_module.c +4 -0
  111. data/src/ruby_supportlib/phusion_passenger.rb +1 -1
  112. data/src/ruby_supportlib/phusion_passenger/constants.rb +1 -1
  113. data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +11 -1
  114. data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +6 -1
  115. data/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb +32 -31
  116. data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +13 -2
  117. data/src/ruby_supportlib/phusion_passenger/standalone/config_utils.rb +1 -0
  118. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +6 -1
  119. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core.rb +6 -0
  120. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/api.rb +29 -19
  121. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/context.rb +2 -2
  122. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter.rb +2 -3
  123. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/simple_json.rb +2 -1
  124. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/spec_helper.rb +2 -0
  125. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/time_point.rb +3 -17
  126. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/transaction.rb +7 -10
  127. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/utils.rb +11 -9
  128. metadata +5 -2
@@ -113,9 +113,8 @@ module PhusionPassenger
113
113
  :name => :socket_backlog,
114
114
  :type => :integer,
115
115
  :cli => '--socket-backlog',
116
- :default => DEFAULT_SOCKET_BACKLOG,
117
116
  :desc => "Override size of the socket backlog.\n" \
118
- "Default: %DEFAULT%"
117
+ "Default: #{DEFAULT_SOCKET_BACKLOG}"
119
118
  },
120
119
  {
121
120
  :name => :ssl,
@@ -175,6 +174,12 @@ module PhusionPassenger
175
174
  :name => :data_buffer_dir,
176
175
  :type => :path,
177
176
  :desc => 'Use the given data buffer directory'
177
+ },
178
+ {
179
+ :name => :core_file_descriptor_ulimit,
180
+ :type => :integer,
181
+ :desc => "Set custom file descriptor ulimit for the\n" \
182
+ "#{SHORT_PROGRAM_NAME} core"
178
183
  }
179
184
  ]
180
185
 
@@ -278,6 +283,12 @@ module PhusionPassenger
278
283
  :desc => "Load shell startup files before loading\n" \
279
284
  'application'
280
285
  },
286
+ {
287
+ :name => :app_file_descriptor_ulimit,
288
+ :type => :integer,
289
+ :desc => "Set custom file descriptor ulimit for the\n" \
290
+ "application"
291
+ },
281
292
  {
282
293
  :name => :debugger,
283
294
  :type => :boolean,
@@ -109,6 +109,7 @@ module PhusionPassenger
109
109
  "(error in config option '#{key}': #{e.message})"
110
110
  end
111
111
  else
112
+ STDERR.puts "*** WARNING: #{filename}: configuration key '#{key}' is not supported"
112
113
  result[key] = val
113
114
  end
114
115
  end
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2014-2015 Phusion Holding B.V.
3
+ # Copyright (c) 2014-2016 Phusion Holding B.V.
4
4
  #
5
5
  # "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  # trademarks of Phusion Holding B.V.
@@ -173,9 +173,14 @@ module PhusionPassenger
173
173
  add_param(command, :python, "--python")
174
174
  add_param(command, :nodejs, "--nodejs")
175
175
  add_param(command, :meteor_app_settings, "--meteor-app-settings")
176
+ add_param(command, :core_file_descriptor_ulimit, "--core-file-descriptor-ulimit")
177
+ add_param(command, :app_file_descriptor_ulimit, "--app-file-descriptor-ulimit")
176
178
 
177
179
  command << " #{Shellwords.escape(@apps[0][:root])}"
178
180
 
181
+ command << " --EC --BU"
182
+ add_param(command, :core_file_descriptor_ulimit, "--core-file-descriptor-ulimit")
183
+
179
184
  return {
180
185
  :identifier => "#{AGENT_EXE} watchdog",
181
186
  :start_command => command,
@@ -330,6 +330,12 @@ module UnionStationHooks
330
330
  nil
331
331
  end
332
332
 
333
+ def get_delta_monotonic
334
+ # When `initialize!` is called, the definition in
335
+ # `api.rb` will override this implementation.
336
+ nil
337
+ end
338
+
333
339
  private
334
340
 
335
341
  def finalize_and_validate_config
@@ -70,12 +70,10 @@ module UnionStationHooks
70
70
 
71
71
  # Workaround for Ruby < 2.1 support where there is no function for querying
72
72
  # the monotonic time.
73
- delta_monotonic = rack_env['PASSENGER_DELTA_MONOTONIC']
74
- if delta_monotonic
75
- delta_monotonic = delta_monotonic.to_i
76
- end
73
+ delta_monotonic_env = rack_env['PASSENGER_DELTA_MONOTONIC']
74
+ set_delta_monotonic(delta_monotonic_env.to_i) if delta_monotonic_env
77
75
 
78
- reporter = RequestReporter.new(context, txn_id, app_group_name, key, delta_monotonic)
76
+ reporter = RequestReporter.new(context, txn_id, app_group_name, key)
79
77
  return if reporter.null?
80
78
 
81
79
  rack_env['union_station_hooks'] = reporter
@@ -149,14 +147,15 @@ module UnionStationHooks
149
147
  # Returns an opaque object (a {TimePoint}) that represents a collection
150
148
  # of metrics about the current time.
151
149
  #
152
- # Various API methods expect you to provide timing information. They
153
- # accept standard Ruby `Time` objects, but it is generally better to
154
- # pass `TimePoint` objects. Unlike the standard Ruby `Time` object,
155
- # which only contains the wall clock time (the real time), `TimePoint`
156
- # may contain additional timing information such as CPU time, time
157
- # spent in userspace and kernel space, time spent context switching,
158
- # etc. The exact information contained in the object is operating
159
- # system specific, hence why the object is meant to be opaque.
150
+ # This TimePoint samples monotonic time (with a fallback to wall clock
151
+ # time) as well as CPU time, time spent in userspace and kernel space,
152
+ # time spent context switching, etc. The exact information contained
153
+ # in the object is operating system specific, hence the object is opaque.
154
+ #
155
+ # You should use it for the various API methods that require timing
156
+ # information. Those methods also accept standard Ruby `Time` objects,
157
+ # but we strongly recommended against doing this, because wall clock
158
+ # time can jump forwards and backwards, which may create issues.
160
159
  #
161
160
  # See {RequestReporter#log_controller_action} for an example of
162
161
  # an API method which expects timing information.
@@ -165,19 +164,28 @@ module UnionStationHooks
165
164
  # information is supposed to be obtained by calling
166
165
  # `UnionStationHooks.now`.
167
166
  #
168
- # In all API methods that expect a `TimePoint`, you can also pass a
169
- # normal Ruby `Time` object instead. But if you do that, the logged
170
- # timing information will be less detailed. Only do this if you cannot
171
- # obtain a `TimePoint` object for some reason.
172
- #
173
167
  # @return [TimePoint]
174
168
  def now
169
+ monotime_usec = Utils.monotime_usec_now
175
170
  pt = Utils.process_times
176
- TimePoint.new(Time.now, pt.utime, pt.stime)
171
+ TimePoint.new(monotime_usec, pt.utime, pt.stime)
172
+ end
173
+
174
+ # Returns a best-estimate delta (usec) between the wallclock and
175
+ # the monotonic clock (updated every request), such that:
176
+ # time_monotic_usec = time_wallclock_usec - delta
177
+ def get_delta_monotonic
178
+ @mono_mutex.synchronize { @delta_monotonic }
177
179
  end
178
180
 
179
181
  private
180
182
 
183
+ # Although the de-facto state seems to be that reading/writing instance variables
184
+ # is MT-safe, it's not guaranteed so better safe than sorry here.
185
+ def set_delta_monotonic(val)
186
+ @mono_mutex.synchronize { @delta_monotonic = val }
187
+ end
188
+
181
189
  def create_context
182
190
  require_lib('context')
183
191
  @@context = Context.new(config[:ust_router_address],
@@ -222,6 +230,8 @@ module UnionStationHooks
222
230
  UnionStationHooks::Log.debugging = true
223
231
  end
224
232
  require_simple_json
233
+ @mono_mutex = Mutex.new
234
+ @delta_monotonic = 0
225
235
  @@initialized = true
226
236
  end
227
237
  end
@@ -173,7 +173,7 @@ module UnionStationHooks
173
173
  end
174
174
  end
175
175
 
176
- def continue_transaction(txn_id, group_name, category, key, delta_monotonic = 0)
176
+ def continue_transaction(txn_id, group_name, category, key)
177
177
  if !@server_address
178
178
  return Transaction.new(nil, nil)
179
179
  elsif !txn_id || txn_id.empty?
@@ -209,7 +209,7 @@ module UnionStationHooks
209
209
  Utils.encoded_timestamp,
210
210
  key,
211
211
  true)
212
- return Transaction.new(@connection, txn_id, delta_monotonic)
212
+ return Transaction.new(@connection, txn_id)
213
213
  rescue SystemCallError, IOError
214
214
  @connection.disconnect
215
215
  UnionStationHooks::Log.warn(
@@ -102,7 +102,7 @@ module UnionStationHooks
102
102
  # in the {RequestReporter class description}.
103
103
  #
104
104
  # @api private
105
- def initialize(context, txn_id, app_group_name, key, delta_monotonic)
105
+ def initialize(context, txn_id, app_group_name, key)
106
106
  raise ArgumentError, 'Transaction ID must be given' if txn_id.nil?
107
107
  raise ArgumentError, 'App group name must be given' if app_group_name.nil?
108
108
  raise ArgumentError, 'Union Station key must be given' if key.nil?
@@ -110,7 +110,6 @@ module UnionStationHooks
110
110
  @txn_id = txn_id
111
111
  @app_group_name = app_group_name
112
112
  @key = key
113
- @delta_monotonic = delta_monotonic
114
113
  @transaction = continue_transaction
115
114
  @next_view_rendering_number = 1
116
115
  @next_user_activity_number = 1
@@ -139,7 +138,7 @@ module UnionStationHooks
139
138
 
140
139
  def continue_transaction
141
140
  @context.continue_transaction(@txn_id, @app_group_name,
142
- :requests, @key, @delta_monotonic)
141
+ :requests, @key)
143
142
  end
144
143
 
145
144
  # Called when one of the methods return early upon detecting null
@@ -29,6 +29,8 @@ require 'strscan'
29
29
  require 'forwardable'
30
30
 
31
31
  module UnionStationHooks
32
+
33
+ # @private
32
34
  module SimpleJSON
33
35
 
34
36
  # Usage:
@@ -38,7 +40,6 @@ module SimpleJSON
38
40
  #
39
41
  # Run tests by executing this file directly. Pipe standard input to the script to have it
40
42
  # parsed as JSON and to display the result in Ruby.
41
- #
42
43
  class JSON
43
44
  def self.parse(data) new(data).parse end
44
45
 
@@ -116,6 +116,8 @@ module UnionStationHooks
116
116
 
117
117
  def initialize_ush_api
118
118
  UnionStationHooks.require_lib('api')
119
+ UnionStationHooks.instance_variable_set(:@mono_mutex, Mutex.new)
120
+ UnionStationHooks.instance_variable_set(:@delta_monotonic, 0)
119
121
  end
120
122
 
121
123
  def initialize_debugging
@@ -26,28 +26,14 @@ module UnionStationHooks
26
26
  # See {UnionStationHooks.now} for more information.
27
27
  class TimePoint
28
28
  # @api private
29
- attr_reader :time, :utime, :stime
29
+ attr_reader :monotime, :utime, :stime
30
30
 
31
31
  # @api private
32
- def initialize(time, utime, stime)
33
- @time = time
32
+ def initialize(monotime, utime, stime)
33
+ @monotime = monotime
34
34
  @utime = utime
35
35
  @stime = stime
36
36
  end
37
37
 
38
- # @api private
39
- def usec_timestamp
40
- @time.to_i * 1_000_000 + @time.usec
41
- end
42
-
43
- # @api private
44
- def usec
45
- @time.usec
46
- end
47
-
48
- # @api private
49
- def to_i
50
- @time.to_i
51
- end
52
38
  end
53
39
  end
@@ -31,10 +31,9 @@ module UnionStationHooks
31
31
  class Transaction
32
32
  attr_reader :txn_id
33
33
 
34
- def initialize(connection, txn_id, delta_monotonic = 0)
34
+ def initialize(connection, txn_id)
35
35
  @connection = connection
36
36
  @txn_id = txn_id
37
- @delta_monotonic = delta_monotonic
38
37
  if connection
39
38
  raise ArgumentError, 'Transaction ID required' if txn_id.nil?
40
39
  connection.ref
@@ -84,37 +83,35 @@ module UnionStationHooks
84
83
  end
85
84
 
86
85
  def log_activity_begin(name, time = UnionStationHooks.now, extra_info = nil)
87
- monotime = Utils.encoded_monotime_now(@delta_monotonic)
88
86
  if extra_info
89
87
  extra_info_base64 = Utils.base64(extra_info)
90
88
  else
91
89
  extra_info_base64 = nil
92
90
  end
93
91
  if time.is_a?(TimePoint)
94
- message "BEGIN: #{name} (#{monotime}," \
92
+ message "BEGIN: #{name} (#{time.monotime.to_s(36)}," \
95
93
  "#{time.utime.to_s(36)},#{time.stime.to_s(36)}) " \
96
94
  "#{extra_info_base64}"
97
95
  else
98
- message "BEGIN: #{name} (#{monotime})" \
96
+ message "BEGIN: #{name} (#{Utils.monotime_usec_from_time(time).to_s(36)})" \
99
97
  " #{extra_info_base64}"
100
98
  end
101
99
  end
102
100
 
103
101
  def log_activity_end(name, time = UnionStationHooks.now, has_error = false)
104
- monotime = Utils.encoded_monotime_now(@delta_monotonic)
105
102
  if time.is_a?(TimePoint)
106
103
  if has_error
107
- message "FAIL: #{name} (#{monotime}," \
104
+ message "FAIL: #{name} (#{time.monotime.to_s(36)}," \
108
105
  "#{time.utime.to_s(36)},#{time.stime.to_s(36)})"
109
106
  else
110
- message "END: #{name} (#{monotime}," \
107
+ message "END: #{name} (#{time.monotime.to_s(36)}," \
111
108
  "#{time.utime.to_s(36)},#{time.stime.to_s(36)})"
112
109
  end
113
110
  else
114
111
  if has_error
115
- message "FAIL: #{name} (#{monotime})"
112
+ message "FAIL: #{name} (#{Utils.monotime_usec_from_time(time).to_s(36)})"
116
113
  else
117
- message "END: #{name} (#{monotime})"
114
+ message "END: #{name} (#{Utils.monotime_usec_from_time(time).to_s(36)})"
118
115
  end
119
116
  end
120
117
  end
@@ -90,20 +90,22 @@ module UnionStationHooks
90
90
  end
91
91
 
92
92
  if Process.const_defined?(:CLOCK_MONOTONIC)
93
- def encoded_monotime_now(delta_monotonic)
94
- time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
95
- timestamp = (time * 1_000_000).to_i
96
- timestamp.to_s(36)
93
+ def monotime_usec_now
94
+ Process.clock_gettime(Process::CLOCK_MONOTONIC, :microsecond)
97
95
  end
98
96
  else
99
- def encoded_monotime_now(delta_monotonic)
100
- time = Time.now
101
- timestamp = time.to_i * 1_000_000 + time.usec - delta_monotonic
102
- timestamp.to_s(36)
97
+ # Workaround for approximating the monotonic clock
98
+ def monotime_usec_now
99
+ monotime_usec_from_time
103
100
  end
104
101
  end
105
102
 
106
- def encoded_timestamp(time = Time.now)
103
+ def monotime_usec_from_time(time = Time.now)
104
+ timestamp = time.to_i * 1_000_000 + time.usec - UnionStationHooks.get_delta_monotonic
105
+ end
106
+
107
+ def encoded_timestamp
108
+ time = Time.now
107
109
  timestamp = time.to_i * 1_000_000 + time.usec
108
110
  timestamp.to_s(36)
109
111
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passenger
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.25
4
+ version: 5.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phusion - http://www.phusion.nl/
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-18 00:00:00.000000000 Z
11
+ date: 2016-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -276,6 +276,7 @@ files:
276
276
  - src/README.md
277
277
  - src/agent/AgentMain.cpp
278
278
  - src/agent/Core/ApiServer.h
279
+ - src/agent/Core/ApplicationPool/AbstractSession.h
279
280
  - src/agent/Core/ApplicationPool/BasicGroupInfo.h
280
281
  - src/agent/Core/ApplicationPool/BasicProcessInfo.h
281
282
  - src/agent/Core/ApplicationPool/Common.h
@@ -306,6 +307,7 @@ files:
306
307
  - src/agent/Core/ApplicationPool/Process.h
307
308
  - src/agent/Core/ApplicationPool/Session.h
308
309
  - src/agent/Core/ApplicationPool/Socket.h
310
+ - src/agent/Core/ApplicationPool/TestSession.h
309
311
  - src/agent/Core/Controller.h
310
312
  - src/agent/Core/Controller/AppResponse.h
311
313
  - src/agent/Core/Controller/BufferBody.cpp
@@ -386,6 +388,7 @@ files:
386
388
  - src/apache2_module/SetHeaders.cpp
387
389
  - src/apache2_module/SetHeaders.cpp.erb
388
390
  - src/apache2_module/mod_passenger.c
391
+ - src/cxx_supportlib/Algorithms/MovingAverage.h
389
392
  - src/cxx_supportlib/AppTypes.cpp
390
393
  - src/cxx_supportlib/AppTypes.h
391
394
  - src/cxx_supportlib/BackgroundEventLoop.cpp