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

Access to firestoreInstanceCache not always synchronized #16668

Open
1 task done
tdickopp opened this issue Nov 14, 2024 · 0 comments · May be fixed by #16675
Open
1 task done

Access to firestoreInstanceCache not always synchronized #16668

tdickopp opened this issue Nov 14, 2024 · 0 comments · May be fixed by #16675
Assignees
Labels
Needs Attention This issue needs maintainer attention. platform: android Issues / PRs which are specifically for Android. plugin: cloud_firestore type: bug Something isn't working

Comments

@tdickopp
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Core

Which platforms are affected?

Android

Description

I got the below stacktrace from a customer (cf. b/375684078). It seems access to firestoreInstanceCache is not synchronized here (and maybe also not here).

Reproducing the issue

  1. Connect to two Firestore instances using the same project but different databases.
  2. Use the "Hot restart" in the (Android?) IDE.

Firebase Core version

2.27.0

Flutter Version

3.19.0

Relevant Log Output

22:52:03.707 E [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception:
PlatformException(java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException:
java.util.ConcurrentModificationException, ExecutionException, Cause:
java.util.concurrent.ExecutionException: java.util.ConcurrentModificationException, Stacktrace:
java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException:
java.util.ConcurrentModificationException (Ask Gemini)
at com.google.android.gms.tasks.Tasks.zza(com.google.android.gms:play-services-
tasks@@18.1.0:5)
at com.google.android.gms.tasks.Tasks.await(com.google.android.gms:play-services-
tasks@@18.1.0:9)
at
io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin.lambda$initializeCore$3$io-flutter-
plugins-firebase-core-FlutterFirebaseCorePlugin(FlutterFirebaseCorePlugin.java:175)
at
io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin$$ExternalSyntheticLambda1.run(Unknown
Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.util.concurrent.ExecutionException:
java.util.ConcurrentModificationException
at com.google.android.gms.tasks.Tasks.zza(com.google.android.gms:play-services-
tasks@@18.1.0:5)
at com.google.android.gms.tasks.Tasks.await(com.google.android.gms:play-services-
io.flutter.plugins.firebase.core.FlutterFirebasePluginRegistry.lambda$didReinitializeFirebaseCore$1(Fl
at
io.flutter.plugins.firebase.core.FlutterFirebasePluginRegistry$$ExternalSyntheticLambda0.run(Unknown
Source:2)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1603)
at java.util.HashMap$EntryIterator.next(HashMap.java:1636)
at java.util.HashMap$EntryIterator.next(HashMap.java:1634)
at
io.flutter.plugins.firebase.firestore.FlutterFirebaseFirestorePlugin.lambda$didReinitializeFirebaseCor
flutter-plugins-firebase-firestore-
FlutterFirebaseFirestorePlugin(FlutterFirebaseFirestorePlugin.java:204)
at
io.flutter.plugins.firebase.firestore.FlutterFirebaseFirestorePlugin$$ExternalSyntheticLambda13.run(Un
Source:4)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
, null)

Flutter dependencies

N/A

Additional context and comments

N/A

@tdickopp tdickopp added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Nov 14, 2024
@SelaseKay SelaseKay added plugin: cloud_firestore platform: android Issues / PRs which are specifically for Android. labels Nov 15, 2024
@russellwheatley russellwheatley self-assigned this Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Attention This issue needs maintainer attention. platform: android Issues / PRs which are specifically for Android. plugin: cloud_firestore type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants