sourcery-ai / sourcery

Instant AI code reviews
https://sourcery.ai
MIT License
1.5k stars 65 forks source link

java.lang.Throwable: Can't remove document listener on Pycharm #391

Closed tungph closed 8 months ago

tungph commented 9 months ago

I've got this exception 4 times for the last 4 days, but not sure how to reproduce it.

java.lang.Throwable: Can't remove document listener (org.wso2.lsp4intellij.editor.DocumentEventManager@1fca5c7). Registered listeners: [com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl$1@538d52da, 362, 0, Multicaster, Multicaster, com.intellij.openapi.editor.impl.event.EditorEventMulticasterImpl$1@50a98b7d]
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:370)
    at com.intellij.openapi.editor.impl.DocumentImpl.removeDocumentListener(DocumentImpl.java:995)
    at org.wso2.lsp4intellij.editor.DocumentEventManager.documentClosed(DocumentEventManager.java:137)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)

Debug Information

IDE Version: PyCharm 2023.2.1 (Professional Edition) Build #PY-232.9559.58, built on August 22, 2023 Runtime version: 17.0.8+7-b1000.8 aarch64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

Sourcery Version: Sourcery 1.10.0

Operating system and Version: MacOS Sonoma 14.0 (23A344)

brendanator commented 9 months ago

Thanks for reporting this @tungph - I'm investigating right now

brendanator commented 9 months ago

I haven't been able to reproduce this either. However, I've made a change that should hopefully stop it from happening. It will be in the release coming out mid next week

tungph commented 8 months ago

@brendanator, I appreciate the update. I updated Sourcery to 1.10.1, but the problem persisted.

image

I would be happy to assist if there was a method to obtain additional debug information on this fault.

brendanator commented 8 months ago

Thanks for this @tungph

They are slightly different issues. I have put in an additional change to try and fix this too. Let me know how you get on when it is released later this week

Hellebore commented 8 months ago

Should be addressed with release of 1.11.0 - @tungph please let us know if this or similar issues do pop up.

tungph commented 8 months ago
image

The issue is still occurring in version 1.11.0 as well.

tungph commented 7 months ago
image