Skip to content

Added delay in startup.kt to account for restart time, if existing IDE process is exiting#3406

Open
namratapal-google wants to merge 1 commit intoJetBrains:masterfrom
namratapal-google:patch-1
Open

Added delay in startup.kt to account for restart time, if existing IDE process is exiting#3406
namratapal-google wants to merge 1 commit intoJetBrains:masterfrom
namratapal-google:patch-1

Conversation

@namratapal-google
Copy link

IJPL-179219, IJPL-185318: Start failed issues

@trespasserw
Copy link
Member

I've acknowledged the PR, but I don't think artificially slowing down the startup is the best solution. I'll take a deeper look later.

@namratapal-google
Copy link
Author

More context on this:

  1. We are investigating Android Studio startup failure issues raised by our end-users.
  2. On investigation, we found that the error directly originates from Intellij, not Android Studio code. Stacktrace is same as IJPL-185318.
  3. Our analysis is that the shutdown process is slow, might hang up due to below dependencies, preventing a restart in IDE restart scenarios: (e.g restart scenario: 'Update' in Jetbrains Toolbox shuts down existing process and tries to start new instance)

Dependencies during IDE shutdown (refer ApplicationImpl.destructApplication):
a. Wait for user confirmation for shutdown when any process (sync / index / any process in progress in terminal) is in progress.
b. AppLifecycleListener(s) - appClosing(), beforeAppWillBeClosed(), appWillBeClosed() - that perform operations before app can be closed.
c. Stop service preloading with ComponentManagerImpl.stopServicePreloading.
d. Save app-level settings.
e. Save project settings.
f. Dispose application container.
g. Attempt to finally finish closing event.

  1. Due to the above 7 or more operations during IDE shutdown process, our analysis is that we have only 3 below options to fix startup failure:
  • Account for each of the above 7 operations and their statuses during startup process, and halt startup until earlier process is fully shutdown. (ApplicationImpl.isExitInProgress can probably be used to halt startup, but whether isExitInProgress accounts for all above 7 operations or not is something to be checked)
  • If existing process is still open during IDE startup, force kill the process and proceed with startup
  • Add few seconds hard-coded wait to alleviate the issue

While I have implemented the 3rd option from above, I think 1st option might be the best one.
LMK your thoughts, will make changes accordingly.

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

Comments