Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into ccng-integration

Change-Id: I126a9ea4e75256ddfb1d90385b531d325f2b619b
  • Loading branch information...
commit 459dc668fd096545b5ee4f2fbde83b1c75455c35 2 parents dd14345 + 9fa8d18
@pietern pietern authored
View
8 Gemfile.lock
@@ -1,8 +1,8 @@
GIT
remote: https://github.com/cloudfoundry/steno.git
- revision: 9334fecdf342800f7e247f2236b66080e4168ec8
+ revision: 5c68aa048c50ee0cf56253a2700ec711aff8f762
specs:
- steno (0.0.17)
+ steno (1.0.2)
grape
yajl-ruby (~> 1.0)
@@ -24,7 +24,7 @@ GIT
GIT
remote: https://github.com/cloudfoundry/warden.git
- revision: 2c3af4e307b6a3a52627bc554466931e0dc4ba70
+ revision: 4c1bb04f863f565be8ed8181e25758145ac739b4
specs:
em-warden-client (0.1.1)
eventmachine
@@ -32,7 +32,7 @@ GIT
warden-protocol (>= 0.0.9)
warden-client (0.0.7)
warden-protocol
- warden-protocol (0.0.9)
+ warden-protocol (0.0.10)
beefcake
GIT
View
18 lib/dea/instance.rb
@@ -215,6 +215,11 @@ def self.schema
optional("debug") => enum(nil, String),
optional("console") => enum(nil, bool),
+
+ # private_instance_id is internal id that represents the instance,
+ # which is generated by DEA itself. Currently, we broadcast it to
+ # all routers. Routers use that as sticky session of the instance.
+ "private_instance_id" => String,
}
end
end
@@ -267,6 +272,10 @@ def initialize(bootstrap, attributes)
# Generate unique ID
@attributes["instance_id"] ||= VCAP.secure_uuid
+
+ # Contatenate 2 UUIDs to genreate a 32 chars long private_instance_id
+ @attributes["private_instance_id"] ||= VCAP.secure_uuid + VCAP.secure_uuid
+
self.state = State::BORN
# Assume non-production app when not specified
@@ -623,9 +632,7 @@ def promise_prepare_start_script
def promise_start
Promise.new do |p|
script = []
- script << "renice 0 $$"
- script << "ulimit -n %d" % self.file_descriptor_limit
- script << "ulimit -u %d" % 512
+
script << "umask 077"
env = Env.new(self)
@@ -646,6 +653,11 @@ def promise_start
request = ::Warden::Protocol::SpawnRequest.new
request.handle = attributes["warden_handle"]
request.script = script.join("\n")
+
+ request.rlimits = ::Warden::Protocol::ResourceLimits.new
+ request.rlimits.nofile = self.file_descriptor_limit
+ request.rlimits.nproc = 512
+
response = promise_warden_call(:app, request).resolve
attributes["warden_job_id"] = response.job_id
View
3  lib/dea/router_client.rb
@@ -41,7 +41,8 @@ def generate_instance_request(instance, opts = {})
"tags" => {
"framework" => instance.framework_name,
"runtime" => instance.runtime_name,
- }
+ },
+ "private_instance_id" => instance.private_instance_id,
}
end
View
3  spec/dea/bootstrap/router_registration_spec.rb
@@ -50,7 +50,8 @@
"tags" => {
"framework" => instances[0].framework_name,
"runtime" => instances[0].runtime_name,
- }
+ },
+ "private_instance_id" => instances[0].private_instance_id,
}
expected_1 = {
Please sign in to comment.
Something went wrong with that request. Please try again.