Fix(fabric): Ensure that Fabric connections do not try to use a catalog once it's been dropped#5314
Merged
Fix(fabric): Ensure that Fabric connections do not try to use a catalog once it's been dropped#5314
Conversation
erindru
commented
Sep 8, 2025
.circleci/continue_config.yml
Outdated
| only: | ||
| - main | ||
| #- gcp-postgres | ||
| #filters: |
erindru
commented
Sep 8, 2025
| self._discard_transaction(thread_id) | ||
| self._thread_attributes.pop(thread_id, None) | ||
|
|
||
| self._thread_attributes.clear() |
Collaborator
Author
There was a problem hiding this comment.
This threw me for a while.
You can set threadlocal data without a connection, but it will only be cleared if a connection was created. This is a problem because calling close_all() and then opening a new connection will pick up old values.
I changed it so that close_all() clears all threadlocal data regardless and then added a test test_thread_local_connection_pool_attributes to prove it's working
georgesittas
approved these changes
Sep 8, 2025
…og once it's been dropped
This reverts commit 8432399.
c2ab42b to
2b66dbe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, connecting to Fabric with an invalid / nonexistent database would succeed and it would just default to the first database in the list.
It appears that Microsoft tightened this behavior up recently, causing errors like this on
main:This PR calls
self.close()on theEngineAdapterafter dropping a catalog to trigger the following behaviour:target_catalogattribute which may point to the catalog that just got droppedIt's a fairly heavy-handed approach, ideally we would selectively close connections that were pointed to the catalog that just got dropped but that was a lot more effort for minimal return because Fabric is not heavily used. If it turns into an issue, it could be revisited