add debugging around potential request throttle config issue

refs FOO-949

test plan: requests succeed with request_throttle config in place

Change-Id: If882cc683fbfcb6b2be9c87827934506203df55d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/247320
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Simon Williams 2020-09-10 09:58:01 -06:00
parent b6cf84025a
commit 89a9f28033
1 changed files with 12 additions and 1 deletions

View File

@ -193,7 +193,18 @@ class RequestThrottle
end
def self.dynamic_settings
@dynamic_settings ||= YAML.safe_load(Canvas::DynamicSettings.find(tree: :private)['request_throttle.yml'] || '') || {}
@dynamic_settings ||= begin
yml_config = Canvas::DynamicSettings.find(tree: :private)['request_throttle.yml']
res = YAML.safe_load(yml_config || '') || {}
if res == true
Rails.logger.error("ERROR: invalid value #{yml_config} from DynamicSettings resulted in `true` result")
cache_contents = LocalCache.cache.instance_variable_get(:@data)&.map{ |k,v|
[k,v] if k.include?("request_throttle")
}&.compact
Rails.logger.error("LocalCache contents for request_throttle: #{cache_contents.to_s}")
end
res
end
end
def rate_limit_exceeded