Skip to content
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.

fix: Move iOS session init at download start into the synchronised block to avoid using invalidated session #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vinicz
Copy link

@vinicz vinicz commented Jan 7, 2021

Hi!

We had a couple of crash reports with this error:

SIGABRT: Task created in a session that has been invalidated

After a bit of investigation, we found that a potential cause of the issue (although it's really hard to reproduce) is that at the download start the initialization of the session is outside of the synchronized block, which could lead to that it could get a session that's invalidated in the meantime because of concurrently finishing tasks. This matches what we saw in the logs as our users started a lot of concurrent downloads, they canceled the tasks (this is an asynchronous action), and soon after that (in a minute) they started again a bunch of tasks. If the cancels just finished when the new downloads are started this could lead to the situation of getting an invalidated session.

We tested this solution and looks working but it's not yet in production and as I mentioned as we cannot reproduce the original crash, so it's not 100% that this PR fixed the issue, but we still think that this could be at least a fix for some cases.

Let me know what do you think.

@aceew
Copy link

aceew commented Apr 1, 2021

Hi, thanks for this change. We needed it to stop some crashes on our app too. @ptelad would it be possible to merge this?

@sidferreira
Copy link

@aceew any plans of merging it? I did a PR too ( #113 ) but this one looks a bit better.

Anyways, we really need to fix this out!

@aceew
Copy link

aceew commented May 19, 2021

@aceew any plans of merging it? I did a PR too ( #113 ) but this one looks a bit better.

Anyways, we really need to fix this out!

I'm not a maintainer unfortunately so I don't have permission to merge or release. I approved as we had tested the fix for our app and confirmed it worked.

@sidferreira
Copy link

@aceew bummer... Starting to feel like this project was abandoned...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants