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

fix: exception on concurrent download of ParseFile from multiple threads #1179

Closed
wants to merge 3 commits into from

Conversation

techyourchance
Copy link

@techyourchance techyourchance commented Aug 21, 2022

New Pull Request Checklist

  • [ x ] I am not disclosing a vulnerability.
  • [ x ] I am creating this PR in reference to an issue.

Issue Description

Related issue: #1155

Approach

This PR simplifies the logic of fetchAsync method and then adds a concurrent code that blocks the second (and further) calling threads until the first thread finishes the download of ParseFile (or fails to do so).

TODOs before merging

  • [ x ] Add tests
  • [ x ] Add changes to documentation (guides, repository pages, in-code descriptions)
  • A changelog entry is created automatically using the pull request title (do not manually add a changelog entry)

…f the same ParseFile from multiple threads
@parse-github-assistant
Copy link

parse-github-assistant bot commented Aug 21, 2022

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Just removing some empty lines...

@mtrezza mtrezza requested a review from a team August 22, 2022 17:44
@mtrezza mtrezza changed the title Bugfix: fixes #1155 - supporting concurrent download of the same ParseFile from multiple threads feat: supporting concurrent download of the same ParseFile from multiple threads Aug 22, 2022
@mtrezza mtrezza changed the title feat: supporting concurrent download of the same ParseFile from multiple threads feat: support concurrent download of the same ParseFile from multiple threads Aug 22, 2022
@mtrezza mtrezza linked an issue Aug 22, 2022 that may be closed by this pull request
4 tasks
@codecov
Copy link

codecov bot commented Aug 22, 2022

Codecov Report

Merging #1179 (d5c50f4) into master (351858c) will not change coverage.
The diff coverage is 0.00%.

@@          Coverage Diff           @@
##           master   #1179   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files         122     122           
  Lines        9962    9970    +8     
  Branches     1343    1345    +2     
======================================
- Misses       9962    9970    +8     
Impacted Files Coverage Δ
...e/src/main/java/com/parse/ParseFileController.java 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@mtrezza mtrezza changed the title feat: support concurrent download of the same ParseFile from multiple threads fix: exception on concurrent download of the same ParseFile from multiple threads Aug 22, 2022
@mtrezza mtrezza changed the title fix: exception on concurrent download of the same ParseFile from multiple threads fix: exception on concurrent download of same ParseFile from multiple threads Aug 22, 2022
@mtrezza mtrezza changed the title fix: exception on concurrent download of same ParseFile from multiple threads fix: exception on concurrent download of ParseFile from multiple threads Aug 22, 2022
Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! Could you take a look at the failing lint test?

@rommansabbir
Copy link
Member

Thanks for the fix! Could you take a look at the failing lint test?

I will take a look at the fail and it seems like Spotless not applied.

@rommansabbir
Copy link
Member

@techyourchance @mtrezza Closing this PR as created a new PR (#1180) by fixing the CI failing issue for Spotless violations.

rommansabbir added a commit to rommansabbir/Parse-SDK-Android that referenced this pull request Aug 23, 2022
@mtrezza mtrezza removed the request for review from a team August 25, 2022 12:07
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.

Crash when fetching ParseFile for the second time
3 participants