Skip to content

Continue freezes IDE #4098

Closed
Closed

Description

@cobrafast

Before submitting your bug report

Relevant environment info

- OS: Windows 10 Pro 22H2 64bit
- Continue version: 0.0.88
- IDE version: JetBrains Rider 2024.3.5
- Model: irrelevant?
- config.json: barebones

Description

Randomly Rider will freze completely and hide the mouse cursor. Only recourse is to kill Rider from Task Manager.

  • Problem does not happen with Continue plug-in disabled.
  • Problem did not happen with Continue 0.0.83.
  • Seems to happen most frequently when editing somehwere in the middle of a line.

To reproduce

  1. Work normally. Problem will occur sooner or later.

Log output

Continue core.log: https://pastebin.com/7xQ27HcX
JetBrains idea.log (excerpt): https://pastebin.com/172sKtBk

Activity

  1. self-assigned this
    on Feb 11, 2025
  2. added
    ide:jetbrains
    kind:bug
    on Feb 11, 2025
  3. AayushSameerShah commented on Feb 13, 2025

    @AayushSameerShah

    It happens to me too. In my case, with VS code, After installing and using the extension for a while, and when we close the VS code, the system removes VS code. So no matter what you do, click on VS code icon, or use "Open with VS Code" anything, the system doesn't find the application.

    We have to uninstall it and reinstall from scratch.

  4. wcde commented on Feb 16, 2025

    @wcde

    Can confirm this in CLion. VS Code works fine.

  5. sestinj commented on Feb 17, 2025

    @sestinj
    Contributor

    Thanks for providing the logs. Unfortunately I'm not seeing anything obvious in there, and it's not something we've reproduced ourselves. Is there any chance you could share a bit more information?

    • Are any of you on ARM64, or all x64?
    • Does this happen on any and all codebases? I'm wondering if it is related to larger codebases and whether this would happen on a tiny codebase
    • Does this still happen if you "Disable Indexing" in the settings page?
  6. cobrafast commented on Feb 17, 2025

    @cobrafast
    Author

    It happened to me on a fresh console project with maybe 30 lines.

  7. 0xbeepea commented on Mar 1, 2025

    @0xbeepea

    This also happened to me while using PyCharm, but doesn't happen when I'm using VS Code.

  8. DJ4ddi commented on Mar 3, 2025

    @DJ4ddi

    Seeing this issue on:

    JetBrains Rider 2024.3
    Build #RD-243.21565.191, built on November 13, 2024
    Runtime version: 21.0.5+8-b631.16 amd64 (JCEF 122.1.9)
    VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
    Toolkit: sun.awt.windows.WToolkit
    Windows 11.0
    .NET Core v8.0.4 x64 (Server GC)
    GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
    Memory: 8192M
    Cores: 32
    Registry:
    ide.experimental.ui=true
    i18n.locale=
    Non-Bundled Plugins:
    org.intellij.plugins.hcl (243.21565.180)
    com.github.continuedev.continueintellijextension (1.0.2)
    fr.socolin.application-insights-debug-log-viewer (2024.3.1)
    Abc.MoqComplete.Rider (2024.1.1.1)
    org.jetbrains.plugins.gitlab (243.21565.204)
    org.jetbrains.plugins.github (243.21565.204-ultimate)
    com.intellij.resharper.azure (4.3.9)

    Same errors as the already attached logs. Tried to collect ETLs with PerfView, but the the processes (both frontend and backend) are doing nothing except keeping themselves alive.

    Seems to happen for projects of any size, only takes a few minutes to happen. Indexing is disabled. Plugin is configured to use an Ollama server in the network (not localhost) for both chat and autocomplete.

  9. Siiiidox commented on Mar 3, 2025

    @Siiiidox

    Can confirm this issue in Rider on x64 Windows. Stops occuring when after I disabled Autocomplete.

  10. pedrxd commented on Mar 7, 2025

    @pedrxd

    Older versions of continue.dev do not have this problem. The bug is common to all JetBrains IDEs, and uninstalling, disabling the plugin or removing autocomplete configuration will fix the problem. It freezes after 5-10 minutes on Windows 64 bits. It happens on all types of projects regardless of size.

    What type of information does the development team need to address the issue?

  11. kclay commented on Mar 8, 2025

    @kclay

    So glad I found this post. Had to disable the plugin because this was happening so much. Using the default recommended setup (Codestral and Claude 3.7 Sonnet). Issue started pre v1 release I want to say .9xx. I updated to the latest version on the EAP channel and still locks up.

    What can I provide to help in trouble shooting this?

  12. ForNeVeR commented on Mar 12, 2025

    @ForNeVeR

    JFYI we've analyzed one user report (RIDER-123774), and found that seemingly the extension causes thread pool exhaustion.

    There are about 63 threads with the same stack trace in the user's dump:

    
    "DefaultDispatcher-worker-9" prio=0 tid=0x0 nid=0x0 runnable
         java.lang.Thread.State: RUNNABLE
     (in native)
    	at [email protected]/java.io.FileInputStream.readBytes(Native Method)
    	at [email protected]/java.io.FileInputStream.read(FileInputStream.java:287)
    	at [email protected]/java.io.BufferedInputStream.read1(BufferedInputStream.java:345)
    	at [email protected]/java.io.BufferedInputStream.implRead(BufferedInputStream.java:420)
    	at [email protected]/java.io.BufferedInputStream.read(BufferedInputStream.java:399)
    	at [email protected]/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:350)
    	at [email protected]/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:393)
    	at [email protected]/sun.nio.cs.StreamDecoder.lockedRead(StreamDecoder.java:217)
    	at [email protected]/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:171)
    	at [email protected]/java.io.InputStreamReader.read(InputStreamReader.java:188)
    	at [email protected]/java.io.BufferedReader.fill(BufferedReader.java:160)
    	at [email protected]/java.io.BufferedReader.implReadLine(BufferedReader.java:370)
    	at [email protected]/java.io.BufferedReader.readLine(BufferedReader.java:347)
    	at [email protected]/java.io.BufferedReader.readLine(BufferedReader.java:436)
    	at IntelliJIDE$getDiff$line$1.invokeSuspend(IntelliJIde.kt:130)
    	at IntelliJIDE$getDiff$line$1.invoke(IntelliJIde.kt)
    	at IntelliJIDE$getDiff$line$1.invoke(IntelliJIde.kt)
    	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
    	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:163)
    	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
    	at IntelliJIDE.getDiff(IntelliJIde.kt:129)
    	at com.github.continuedev.continueintellijextension.continue.IdeProtocolClient$handleMessage$1.invokeSuspend(IdeProtocolClient.kt:273)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
    	at kotlinx.coroutines.internal.SoftLimitedDispatcher$Worker.run(SoftLimitedDispatcher.kt:125)
    	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
    	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
    	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)
    

    My recommendation for the extension would be to either use some sort of asynchronous IO, somehow limit its parallelism, or use a separate thread pool for its work. Using 63 threads for blocking IO (about 252 MiB of memory just for the stacks of these threads, that is!) seems suboptimal.

  13. auderson commented on Mar 19, 2025

    @auderson

    same here, disabling tab completion is a workaround. hope it will be fix soon!

  14. Patrick-Erichsen commented on May 6, 2025

    @Patrick-Erichsen
    Contributor

    Hi all, apologies for the delays in following up here. Appreciate all the troubleshooting that's been done to this point, especially the link out to RIDER-123774.

    What's interesting is that this appears to be an issue for all JetBrains IDEs except IntelliJ - @ForNeVeR , any chance you'd have context on why this would be the case?

  15. ForNeVeR commented on May 6, 2025

    @ForNeVeR

    The issue found in scope of RIDER-123774 is a general one. My only hypothesis so far is that the plugin somehow goes under the limit in IntelliJ IDEA (in cases you've checked manually, at least: it could easily work differently between languages such as Kotlin vs Java). Other IDEs might have some different completion behavior (e.g. call pre-emptive completion on each typing, perhaps unlike IDEA, though I am not a completion specialist and it's a bit harder for me to say) leading to more simultaneous requests spawned at once — and locking the IDE with highler probability.

    The general advice still stands: I recommend using a separate (reasonably limited) thread pool for this activity (to not limit the main system pool), and prefer async (and cancellable — and actually cancel it when not required, e.g. when a completion request is obsolete) IO over blocking IO when possible. This should save the resources in general, and in particular resolve the problem at hand.

    Probably you can start from this place in the extension code:

    Here you use system's Dispatchers.IO which is perfectly fine for finite and rare activities, but not fine if you have a capability to spawn to to 64 threads for completion activities.

    Note that Dispatchers.IO (documentation) is limited to 64 threads by default — and that's the whole IDE, not only your extension alone. Which is an arguable decision from the coroutine library standpoint, but it is what it is.

    I'd recommend you to

    • create a new pool by using Dispatchers.IO.limitedParallelism(4) — see the documentation on how it's supposed to help (esp. w.r.t. the elastic property of the IO dispatcher), and run all your completion on that pool exclusively. This will save the IDE pool even in the worst case scenarios, and prevent it from completely locking.
    • update the API for IdeProtocolClient::handleMessage to require some sort of cancellation to there (you might want to make it to accept a CoroutineScope or something like that) — to cancel outstanding requests in a timely manner and avoid littering the dispatcher with any outdated requests
      • sadly, here my (very bare) understanding of the extension code ends, and I was unable to quickly find places where it actually ties to the editor's state and where I would place such cancellation of completion requests; perhaps you'll have a better idea of this than me
  16. added
    os:windows
    on May 7, 2025
  17. Patrick-Erichsen commented on May 9, 2025

    @Patrick-Erichsen
    Contributor

    @ForNeVeR opened up #5600 with your advice on limiting thread count. Making handleMessage cancellable is definitely the right next step here, but want to get this initial fix out ASAP to hopefully stop full blown IDE crashes from occurring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ide:jetbrainskind:bugos:windows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions