Skip to content

Conversation

@davisg123
Copy link
Contributor

@davisg123 davisg123 commented Feb 13, 2022

We were encountering this issue:
#54

The PR for the issue (#111) does prevent background crashes due to the upload task now completing on time

However, there is still an issue; application.endBackgroundTask is not called for tasks that do happen to expire in the background

UploadTaskInfo as a value type is captured by beginBackgroundTask before the cleanup handler is assigned. You can see the issue by running version 1.0.6 where tasks expired often and set the breakpoint as seen in the attached screenshot

My fix is to no longer capture self in either closure.

Screen Shot 2022-02-12 at 4 31 44 PM

@bsneed bsneed merged commit 0a84fa2 into segmentio:main Feb 16, 2022
@bsneed
Copy link
Contributor

bsneed commented Feb 16, 2022

Thanks @davisg123 ! Just merged. I'm gonna do another PR to remove taskID since it's no longer needed. Great catch!

@bsneed bsneed mentioned this pull request Feb 16, 2022
@davisg123 davisg123 deleted the davis/incomplete-structs-captured branch February 17, 2022 02:13
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.

2 participants