Skip to content

Conversation

@DmitriyMusatkin
Copy link
Contributor

@DmitriyMusatkin DmitriyMusatkin commented Jul 15, 2025

Issue #, if available:

Description of changes:
future bitpacks several variables into uint32
https://github.com/awslabs/aws-c-io/blob/main/source/future.c#L54

tsan will complain if those variables are accessed from different threads.
this pr fixes the data race from aws_future_impl_get_result_by_move updating owns_data variable and aws_future_impl_set_error reading is_done, by unpacking the variables.

future->owns_result = false;

bool first_time = !future->is_done;

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@DmitriyMusatkin DmitriyMusatkin changed the title mutex future update of own_data variable wrap future update of own_data variable in mutex Jul 15, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jul 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.66%. Comparing base (25faa8d) to head (bc3db4d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #741   +/-   ##
=======================================
  Coverage   78.66%   78.66%           
=======================================
  Files          30       30           
  Lines        6374     6374           
=======================================
  Hits         5014     5014           
  Misses       1360     1360           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DmitriyMusatkin DmitriyMusatkin changed the title wrap future update of own_data variable in mutex stop packing future variable to avoid tsan data race warnings Jul 16, 2025
Copy link
Contributor

@graebm graebm left a comment

Choose a reason for hiding this comment

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

fix & ship

@DmitriyMusatkin DmitriyMusatkin merged commit 12cb9f9 into main Jul 16, 2025
144 of 148 checks passed
@DmitriyMusatkin DmitriyMusatkin deleted the buffer_cancel branch July 16, 2025 18:44
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.

3 participants