Status Update
Comments
mm...@google.com <mm...@google.com>
je...@google.com <je...@google.com>
ga...@google.com <ga...@google.com> #2
@Reporter Do you have a way to reproduce this consistently? If so, can you please share the steps?
I was able to reproduce once with F C10, SqlDelight IDE plugin (1.5.3), and KTS, but I could not find a consistent repro.
xof, do you think this can happen because of GradleConnectorService.connectorsMap
caching? I remember you were recently looking into something similar.
xo...@google.com <xo...@google.com> #3
This isn't a symptom I have seen before. Do you have multiple projects open?
ga...@google.com <ga...@google.com> #4
As a data point, I only had MyApplication79
open when I hit this in #2. I'm wondering if this is related to 3 model queries that can happen:
ga...@google.com <ga...@google.com> #5
Another instance in
xo...@google.com <xo...@google.com> #6
I have been working for the last couple of days with the SqlDelight IDE plugin enabled in my development Android Studio.
I managed to trigger the symptom once, in that time. Unfortunately, it was during a deep debugging session of a different problem, and I didn't notice that I'd triggered it until I restarted the IDE, meaning that I lost the state.
I also observe that SqlDelight is, twice a second, attempting to fetch models / initialize the file index.
2023-02-28 16:44:13,915 [3747636] INFO - SQLDelight[My Application] - Fetching SQLDelight models
2023-02-28 16:44:13,983 [3747704] INFO - SQLDelight[My Application] - Initialized file index
2023-02-28 16:44:14,358 [3748079] INFO - SQLDelight[My Application] - Fetching SQLDelight models
2023-02-28 16:44:14,484 [3748205] INFO - SQLDelight[My Application] - Initialized file index
2023-02-28 16:44:14,862 [3748583] INFO - SQLDelight[My Application] - Fetching SQLDelight models
2023-02-28 16:44:14,996 [3748717] INFO - SQLDelight[My Application] - Initialized file index
2023-02-28 16:44:15,357 [3749078] INFO - SQLDelight[My Application] - Fetching SQLDelight models
...
(I think this is triggered by attempting to use a project where we have cached models but a subsequent sync has failed.)
xo...@google.com <xo...@google.com> #7
Still very much in investigation mode:
in SqlDelight's FileIndexMap.kt
I see:
val javaHome =
ExternalSystemJdkUtil.getJdk(project, ExternalSystemJdkUtil.USE_JAVA_HOME)
?.homeDirectory?.path?.let { File(it) }
val properties =
connection.action(FetchProjectModelsBuildAction).setJavaHome(javaHome).run()
if the JVM being used to run Gradle by Studio's sync is different from the JVM in JAVA_HOME
, would this lead to one or other connection being closed?
(FileIndexMap.kt
is also I think responsible for my observed twice-a-second behavior above: if the FetchProjectModelsBuildAction
fails, for example because of an error in the Gradle build configuration, then nothing will ever be cached in fileIndexes
; FetchModuleModels
will catch and handle the ExternalSystemException
, meahing that FileIndexMap.get()
will essentially fail but not increment retries
.)
xo...@google.com <xo...@google.com> #8
Is this connection breaking still reproducible with the current SqlDelight?
I see
xo...@google.com <xo...@google.com> #10
(no further data: assuming that this has been fixed with current SqlDelight, but please open a new issue if it reproduces)
Description
Every time I launch Android Studio (I use Jetbrains Toolbox), Gradle Sync fails with the following error message:
Restarting the sync fixes the problem.
Please find the idea.log attached.