-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
No events emitted from storage tasks on secondary apps? #10463
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
The fastest way to reproduce this based on react-native-firebase context (that is: objective-c), in my humble opinion, may be to extend the objc integration test here to also do a secondary app putString and make sure events are observed? If that sounds like a reasonable strategy to check reproduction here and there was no one on firebase-ios-sdk side with the test rig set up for easy manipulation, I could give it a try |
Thanks for the report @mikehardy. I'll take a look today. |
I'm seeing a deadlock in GTMSessionFetcher when operations are done on two apps: cc: @thomasvl
|
Can you be a bit more specific than when operations are done on two apps? The trace also seems to only be one process. What's the other process doing? What version of GTMSessionFetcher are you talking about here? |
Glad this repro'd on your side at least, I was going to be stumped if this was at the react-native-firebase level and I hate to waste time asking for failed repro's. @thomasvl from Podfile.lock --> - GTMSessionFetcher/Core (2.1.0) It can be only one process, in our case it is two different "firebase apps" - the storage module allows secondary apps, which may be configured and used indepdently of the main app (e.g. So in one process you may access storage on the |
Ok, one app greatly changes things, that's likely a priority inversion issue then. v2.2.0 removes the use of a pthread mutex to avoid the issue (google/gtm-session-fetcher#324), so if you've got a repo, please try with v2.2.0 and see if it now goes away. |
Okay, I attempted to force pod It seemed to hang again, it behaved exactly the same, in my perception I attempted to reproduce (note: my reproduction is likely different than @paulb777 reproduction...) and do the same Resulting thread stack dump is below - hopefully that's useful, I'm only marginally qualified to drive Xcode+lldb etc based on C/C++ from uni about 300 years ago. Apologies if it's not useful
|
To help narrow this down, did this happen with older versions also? (v2.0.0?) I'll have to go back through changes, but aside from the PR I linked that changed things in 2.2, I don't recall anything that should have changes these sorta things recently. |
By two apps, I mean two Firebase Apps which means two GTMSessionFetcherService instances instead of one. I'll continue to narrow my repro. The problem could be related to the Firebase implementation going from ObjC to Swift and how it's using GTMSessionFetcher. I'll see if changing only GTMSessionFetcher makes a difference. |
So one process, but two Looking at @mikehardy recent trace, there appears to only be one thread with GTMSessionFetcher symbols, which does sorta point in the direction of maybe something else is also doing an |
@mikehardy if you can go back to v2.1.0 of GTMSessionFetcher and also try reverting whatever Firebase versions you recently changed, that might also help narrow down the combination of what might be causing things. |
I can do that but want to hear what @paulb777 thinks is best strategy for repro first, simply because my repro is one layer up and is thus far from minimal, I wonder about some confounding effects with more parts in play, and I think the integration test here (which Paul can probably drive while asleep, altering versions at will) is going to be a lot more focused. So I will wait for a moment to hear Paul's thoughts, but I'll do whatever seems useful if I can help advance it. I appreciate the attention on the issue |
I have a smaller repro case now from the Firebase Storage Swift Integration tests: After setting up It's possible the issue is related to the Authentication protocol introduced in 2.1 that we're using for the Swift authentication. That causes additional calls to
|
What does |
@MorganChen found https://straypixels.net/swift-dictionary-locking/ which doesn't exactly match what we're seeing, but may be related since its seems like the runtime is creating a lock that never gets released. |
I haven't pinned down the exact cause, but here's what I've found:
Observations:
The reason the next call to |
This should be fixed and out with 10.2.0. |
@mikehardy Would you check if the fix in https://github.com/firebase/firebase-ios-sdk/pull/10468/files fixes your repro case? |
Just caught up on the thread. Subtle one! Our reproductions looked like they lined up at the end, so I'll be surprised if it isn't fixed when you think it is but I will check first thing tomorrow, for confirmation. Cheers |
Pulled https://patch-diff.githubusercontent.com/raw/firebase/firebase-ios-sdk/pull/10468.diff built + ran just fine ✔️ Thanks all, looking forward to firebase-ios-sdk 10.2.0 |
Description
Hi there! It appears based on a user report in react-native-firebase from @brianGammon (who bisected our versions even: 🥇) and my investigation of the same that firebase-ios-sdk StorageUploadTask (at least) is not emitting observable events for secondary apps since the release of firebase-ios-sdk v10.0.0
This is something that used to work on firebase-ios-sdk < v10
What we expect to happen is success with a use case like:
1- initialize firebase app (for example, default app)
2- use that app to perform any storage operation (for example, getting a reference, then creating a storage upload task that does a putData
3- add observers to the task and you will see observable events
4- initialize a secondary firebase app
5- do the same reference creation, storage upload task etc using the secondary app
6- add observers to the task and for us at least, I do not see observable events
Steps 1 through 5 work fine but that step 6 is the issue: it appears that whatever app is used first in storage will work but whatever app is used after the first does not see events.
Reproducing the issue
It is always difficult distilling our react-native-firebase e2e tests to an MCVE, please bear with me/us.
I've prepared this branch showing
DLog
statements added where we diagnose things, and a new e2e test that triggers the problem.Branch is here: https://github.com/invertase/react-native-firebase/tree/%40mikehardy/storage-secondary-app-no-events
The changes in this file in particular show our usage of firebase-ios-sdk API, with log statements added, so you can see the exact sequence of storage APIs in play
invertase/react-native-firebase@9000a59#diff-a1ebeb5a270518df94ba9c1257fda0fce39ff3fb494b57224dff3399917b6f94
When you run a test that does a putData on primary app then does secondary app, this is the log I paste below is generated - everything is fine with events observed on the primary app putData, then the app is just hanging with no events in the second app
Firebase SDK Version
10.1.0
Xcode Version
14.0
Installation Method
CocoaPods
Firebase Product(s)
Storage
Targeted Platforms
iOS
Relevant Log Output
If using CocoaPods, the project's Podfile.lock
Expand
Podfile.lock
snippetThe text was updated successfully, but these errors were encountered: