trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.49k stars 3.02k forks source link

Ensure module instances are not shared by multiple JDBC catalogs #24058

Closed piotrrzysko closed 1 week ago

piotrrzysko commented 2 weeks ago

Description

When a JdbcPlugin is instantiated, creating an instance of a module at that time causes the instance to be shared by all connectors provided by the plugin. This is problematic when the module extends AbstractConfigurationAwareModule, as it holds a reference to the ConfigurationFactory, which is set dynamically during bootstrap. If catalogs are loaded concurrently, this can lead to situations where a connector accesses the configuration of another connector.

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required. ( ) Release notes are required. Please propose a release note for me. (x) Release notes are required, with the following suggested text:

## Section
* Fix potential configuration leakage between JDBC catalogs. ({issue}`issuenumber`)
wendigo commented 2 weeks ago

Just couple of nitpicks