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

Add check for already processed resumptions to ResumptionDataProcessor #3525

Conversation

ychernysheva
Copy link
Contributor

Fixes #3522

This PR is ready for review.

Risk

This PR makes no API changes.

Summary

This PR is intended to improve synchronization in ResumptionDataProcessorImpl::Restore() method. Root cause of this problem is a case when some requests from HMI may be processed earlier than callback will be set in ResumptionDataProcessor. So in this case execution of ProcessResumptionStatus method for such application will be aborted due to absence of callback, and this behavior is valid and expected. But after this variable is_requests_list_empty will be assigned to true, and there is a problem, because now Restore() method doesn't have any checks for actual result of already performed operation. That's why in all such cases, regardless of actual resumption status, callback will be called with parameters mobile_apis::Result::SUCCESS and "Data resumption successful".

That's why corresponding check is added to Restore method, also some refactoring is performed to avoid duplication of code, redundant check HasDataToRestore is deleted (now in fact it will be always true), and potential source of memory leak in EraseAppResumptionData method is fixed (before only last request was deleted from request_app_ids_ map).

In current environment this issue is hard to reproduce, but it may be a problem if this code is used in other environment or in other systems (for example, with proprietary hardware) without synchronization improvement.

CLA

@ychernysheva
Copy link
Contributor Author

@theresalech This fix is ready for review.
Thank you!

@theresalech theresalech added 7.0 Release issues introduced by 7.0 release candidate and removed 7.0 Release issues introduced by 7.0 release candidate labels Oct 5, 2020
@dboltovskyi dboltovskyi added the CI should be targeted for CI/CT checks by jenkins label Oct 5, 2020
@dboltovskyi
Copy link
Contributor

Rebuild required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI should be targeted for CI/CT checks by jenkins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants