rails 7.1: fix re-entrancy issue with marginalia and new connections

new connections run queries to populate the PG type map. if we've
recently cleared the columns cache (like when creating a new shard),
then calling an attribute method in order to add a marginalia comment
will consult the columns hash, and cause a new query... within the
configure_connection method, before it has actually been fully
configured, and thus will fail trying to access the pg_type_map field
for that inner query. avoid the re-entrancy by using direct attribute
access, which doesn't need to check the columns_hash

Change-Id: Ia98cca14d33d69a552f9c7e40704bc5ef6e4250e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/350762
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2024-06-21 13:31:22 -06:00
parent 8d090c86df
commit eac802cbbb
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ if config[:components].present?
end
def job_tag
Delayed::Worker.current_job&.tag
Delayed::Worker.current_job&.[]("tag")
end
end
end