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

Data race warning from Xcode for HttpResponse.statusCode. #1324

Closed
sichanyoo opened this issue Feb 5, 2024 · 2 comments
Closed

Data race warning from Xcode for HttpResponse.statusCode. #1324

sichanyoo opened this issue Feb 5, 2024 · 2 comments
Assignees
Labels
bug This issue is a bug.

Comments

@sichanyoo
Copy link
Contributor

sichanyoo commented Feb 5, 2024

Describe the bug

Xcode throws a warning for data race for statusCode property of HttpResponse as shown below.

Image

This tracks the SIM ticket: /V1219649867.

Expected Behavior

No data race warning shown for properties of HttpResponse.

Current Behavior

Xcode shows a data race warning for statusCode property of HttpResponse.

Reproduction Steps

  • Use Amplify Swift Package version 2.25.5
  • Download application files from /V1219649867/communication.
  • Enable Thread Sanitizer on Xcode to see it detect and show data race warning.

Possible Solution

Make HttpResponse an actor to make it thread-safe.

Additional Information/Context

No response

AWS SWIFT SDK version used

0.31.0

Compiler and Version used

Xcode 15.0

Operating System and version

MacOS

@sichanyoo
Copy link
Contributor Author

From offline discussion: The PRs for this ticket will be put on-hold until deeper investigation is done by @jbelkins and @sichanyoo & it's confirmed all continuation code paths call resume() exactly once.

Also discussed: refactoring CRT HTTP client wrapper in SDK side might be a good follow-up task to this

@sichanyoo
Copy link
Contributor Author

Ticket is raised on upstream (Amplify) as well: aws-amplify/amplify-swift#3708
Getting back on this ticket now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

1 participant