-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#25652] Fix TSAN issue with accessing the PgClientSessionContext::cl…
…ient field Summary: The `PgClientSessionContext::client` field is initialized once in one thread. And other threads performs only reads from this field (and only after initialization is fully completed). Relying on the fact the fields' value is never changed the reader threads perform read of the field in non atomic fashion. But field's initialization is performed in multi thread environment. For this purpose `compare_exchange_strong` function is used. But after full initialization `compare_exchange_strong` is still executed and it may write same value into the memory. As a result it is not safe to read value in non atomic fashion. Simplest solutions (which is implemented in current diff) is to move `client_` field out of the `PgClientSessionContext` structure and store it individually in each `PgClientSession` object. Jira: DB-14902 Test Plan: Jenkins Reviewers: sergei, hsunder, bkolagani, esheng Reviewed By: sergei Subscribers: ybase, yql Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D41372
- Loading branch information
1 parent
06cd407
commit 9bc1dd9
Showing
3 changed files
with
26 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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