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

Force pending saves if client closes abruptly #6514

Merged
merged 6 commits into from
May 3, 2023

Conversation

hubertp
Copy link
Collaborator

@hubertp hubertp commented May 2, 2023

Pull Request Description

Force pending saves when JsonSession is terminated for the client.

Potentially closes #6395.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@@ -292,6 +292,11 @@ class LanguageServerController(
maybeRequester.foreach(_ ! ServerShutdownTimedOut)
stop()

case ClientDisconnected(clientId) =>
Copy link
Collaborator Author

@hubertp hubertp May 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra change that deals with unexpected messages during shutdown:

INFO ide_ci::program::command: enso⚠️ [warn] [2023-05-01T10:29:13.187Z] [org.enso.projectmanager.boot.ProjectManager$] Failed to read line.
 INFO ide_ci::program::command: enso⚠️ [info] [2023-05-01T10:29:13.187Z] [org.enso.projectmanager.boot.ProjectManager$] Stopping server...
 INFO ide_ci::program::command: enso⚠️ [info] [2023-05-01T10:29:13.188Z] [org.enso.projectmanager.infrastructure.languageserver.LanguageServerKiller] Killing all servers [List(Actor[akka://project-manager/user/language-server-registry/language-server-controller-21260df1-f569-43d3-b2b2-d70944d8db8b#1107631448])].
 INFO ide_ci::program::command: enso⚠️ [info] [2023-05-01T10:29:13.19Z] [org.enso.projectmanager.protocol.ClientController] Client disconnected from the Project Manager [9388d3fc-ac7d-4158-96b5-aea97429966b]
 INFO ide_ci::program::command: enso⚠️ [warn] [2023-05-01T10:29:13.19Z] [org.enso.projectmanager.infrastructure.languageserver.LanguageServerController] Received unknown message: class org.enso.projectmanager.event.ClientEvent$ClientDisconnected

@hubertp hubertp added the CI: No changelog needed Do not require a changelog entry for this PR. label May 2, 2023
@hubertp hubertp force-pushed the wip/hubert/6395-force-pending-saves-on-close branch from 3a09bd9 to 92bb306 Compare May 2, 2023 20:19
Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flushing pending save requests is certainly a good idea.

@hubertp hubertp added the CI: Clean build required CI runners will be cleaned before and after this PR is built. label May 3, 2023
hubertp added 6 commits May 3, 2023 17:49
Haven't been able to reproduce but, theoritically, it is possible for
pending applies to not be saved when shutting down.
When JsonSession is terminated we didn't force pending auto-saves.
@hubertp hubertp force-pushed the wip/hubert/6395-force-pending-saves-on-close branch from 92bb306 to 8e25690 Compare May 3, 2023 15:55
@hubertp hubertp added the CI: Ready to merge This PR is eligible for automatic merge label May 3, 2023
@mergify mergify bot merged commit b93edb0 into develop May 3, 2023
@mergify mergify bot deleted the wip/hubert/6395-force-pending-saves-on-close branch May 3, 2023 23:30
Procrat added a commit that referenced this pull request May 4, 2023
* develop:
  Fix cut-off in text visualisations (#6421)
  Infer correct synthetic name for nested modules (#6525)
  Delete unused websocket dependency (#6535)
  Run typecheck and eslint on `./run lint` (#6314)
  Force pending saves if client closes abruptly (#6514)
  Continued Execution Context work and some little fixes (#6506)
  IDE's logging to a file (#6478)
  Fix application config (#6513)
  Cloud/desktop mode switcher (#6448)
  Fix doubled named arguments bug (#6422)
  Reimplement `enso_project` as a proper builtin (#6352)
  Fix layer ordering between dropdown and breadcrumbs backgrounds.  (#6483)
  Multiflavor layers (#6477)
  DataflowAnalysis preserves dependencies order (#6493)
  Implement `create_database_table` for Database Table (#6467)
  Limit Dead Letter logging (#6482)
  More reliable shutdown of the EnsoContext to save resources (#6468)
  Make execution mode `live` default for CLI (#6496)
Procrat added a commit that referenced this pull request May 4, 2023
…-5075

* develop:
  Build nightly 3 hours earlier. (#6551)
  Cache result of slow function resolution on Any that is present on a hot path (#6536)
  Fix cut-off in text visualisations (#6421)
  Infer correct synthetic name for nested modules (#6525)
  Delete unused websocket dependency (#6535)
  Run typecheck and eslint on `./run lint` (#6314)
  Force pending saves if client closes abruptly (#6514)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Clean build required CI runners will be cleaned before and after this PR is built. CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Component Browser creates node not visible in the graph editor until Enso restart
3 participants