Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect the logging state storage for threaded access. #426

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

thomasvl
Copy link
Member

@thomasvl thomasvl commented Jan 2, 2025

The thread sanitizer properly flagged a case of this, so generally fix the problem. Since multiple fetches could happen in parallel, some of these can be lazy initialized in parallel, and thus exposed to threading issues, protect the access to avoid any issues.

@thomasvl thomasvl requested a review from dmaclach January 2, 2025 18:29
Sources/Core/GTMSessionFetcherLogging.m Outdated Show resolved Hide resolved
Sources/Core/GTMSessionFetcherLogging.m Show resolved Hide resolved
Sources/Core/GTMSessionFetcherLogging.m Show resolved Hide resolved
Sources/Core/GTMSessionFetcherLogging.m Show resolved Hide resolved
The thread sanitizer properly flagged a case of this, so generally fix the
problem. Since multiple fetches could happen in parallel, some of these can be
lazy initialized in parallel, and thus exposed to threading issues, protect the
access to avoid any issues.
@thomasvl thomasvl force-pushed the logging_state_storage branch from c8729ac to 95ef539 Compare January 6, 2025 17:07
Copy link
Collaborator

@dmaclach dmaclach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomasvl thomasvl merged commit 5715343 into google:main Jan 7, 2025
25 checks passed
@thomasvl thomasvl deleted the logging_state_storage branch January 7, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants