Skip to content

Commit

Permalink
Remove temporary_ignore_server_unavailable_errors config
Browse files Browse the repository at this point in the history
- this temporary config flag was used to ignore server unavailable
errors coming back from log-cache (or metric-proxy in cf-for-k8s)
- given the change proposed in #2227 to rescue
more errors and serve partial stats responses this config is no longer
necessary

Authored-by: Tim Downey <[email protected]>
  • Loading branch information
tcdowney committed Apr 29, 2021
1 parent 37e1003 commit 2abeb94
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 17 deletions.
1 change: 0 additions & 1 deletion config/cloud_controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ loggregator:
logcache:
host: 'http://doppler.service.cf.internal'
port: 8080
temporary_ignore_server_unavailable_errors: false

logcache_tls:
key_file: 'spec/fixtures/certs/log_cache.key'
Expand Down
1 change: 0 additions & 1 deletion lib/cloud_controller/config_schemas/base/api_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ class ApiSchema < VCAP::Config
logcache: {
host: String,
port: Integer,
temporary_ignore_server_unavailable_errors: bool,
},

optional(:logcache_tls) => {
Expand Down
1 change: 0 additions & 1 deletion lib/cloud_controller/dependency_locator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ def build_logcache_client
client_cert_path: config.get(:logcache_tls, :cert_file),
client_key_path: config.get(:logcache_tls, :key_file),
tls_subject_name: config.get(:logcache_tls, :subject_name),
temporary_ignore_server_unavailable_errors: config.get(:logcache, :temporary_ignore_server_unavailable_errors)
)
end

Expand Down
4 changes: 1 addition & 3 deletions lib/logcache/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Client
MAX_LIMIT = 1000
DEFAULT_LIMIT = 100

def initialize(host:, port:, client_ca_path:, client_cert_path:, client_key_path:, tls_subject_name:, temporary_ignore_server_unavailable_errors:)
def initialize(host:, port:, client_ca_path:, client_cert_path:, client_key_path:, tls_subject_name:)
if client_ca_path
client_ca = IO.read(client_ca_path)
client_key = IO.read(client_key_path)
Expand All @@ -25,8 +25,6 @@ def initialize(host:, port:, client_ca_path:, client_cert_path:, client_key_path
timeout: 250
)
end

@temporary_ignore_server_unavailable_errors = temporary_ignore_server_unavailable_errors
end

def container_metrics(source_guid:, envelope_limit: DEFAULT_LIMIT, start_time:, end_time:)
Expand Down
19 changes: 11 additions & 8 deletions spec/logcache/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ module Logcache
let(:channel_arg_hash) { { GRPC::Core::Channel::SSL_TARGET => tls_subject_name } }
let(:client) do
Logcache::Client.new(host: host, port: port, client_ca_path: client_ca_path,
client_cert_path: client_cert_path, client_key_path: client_key_path, tls_subject_name: tls_subject_name,
temporary_ignore_server_unavailable_errors: false)
client_cert_path: client_cert_path, client_key_path: client_key_path, tls_subject_name: tls_subject_name)
end
let(:client_ca) { File.open(client_ca_path).read }
let(:client_key) { File.open(client_key_path).read }
Expand Down Expand Up @@ -78,8 +77,7 @@ module Logcache

let(:client) do
Logcache::Client.new(host: host, port: port, client_ca_path: client_ca_path,
client_cert_path: client_cert_path, client_key_path: client_key_path, tls_subject_name: tls_subject_name,
temporary_ignore_server_unavailable_errors: false)
client_cert_path: client_cert_path, client_key_path: client_key_path, tls_subject_name: tls_subject_name)
end

it 'retries the request three times and raises an exception' do
Expand Down Expand Up @@ -110,8 +108,7 @@ module Logcache

let(:client) do
Logcache::Client.new(host: host, port: port, client_ca_path: client_ca_path,
client_cert_path: client_cert_path, client_key_path: client_key_path, tls_subject_name: tls_subject_name,
temporary_ignore_server_unavailable_errors: false)
client_cert_path: client_cert_path, client_key_path: client_key_path, tls_subject_name: tls_subject_name)
end

it 'raises an exception' do
Expand Down Expand Up @@ -150,8 +147,14 @@ module Logcache

describe 'without TLS' do
let(:client) do
Logcache::Client.new(host: host, port: port, temporary_ignore_server_unavailable_errors: false,
client_ca_path: nil, client_cert_path: nil, client_key_path: nil, tls_subject_name: nil)
Logcache::Client.new(
host: host,
port: port,
client_ca_path: nil,
client_cert_path: nil,
client_key_path: nil,
tls_subject_name: nil
)
end

describe '#container_metrics' do
Expand Down
3 changes: 0 additions & 3 deletions spec/unit/lib/cloud_controller/dependency_locator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@
client_cert_path: nil,
client_key_path: nil,
tls_subject_name: nil,
temporary_ignore_server_unavailable_errors: false
)
end

Expand All @@ -513,7 +512,6 @@
logcache: {
host: 'some-logcache-host',
port: 1234,
temporary_ignore_server_unavailable_errors: false,
},
logcache_tls: {
ca_file: 'logcache-ca',
Expand All @@ -531,7 +529,6 @@
client_cert_path: 'logcache-client-ca',
client_key_path: 'logcache-client-key',
tls_subject_name: 'some-tls-cert-san',
temporary_ignore_server_unavailable_errors: false
)
end
end
Expand Down

0 comments on commit 2abeb94

Please sign in to comment.