-
Notifications
You must be signed in to change notification settings - Fork 317
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get server back into working state #107
Conversation
The server was freezing because it was running compile on the main thread.
Previously, we used Task.now to eagerly compute all values. This blocked up the server immediately and made the server fail to handle requests like shutdown. This commit also reduces noise in the logs, which made it easier to debug what was happening. Previously we logged everything messages to the client, including the fact that we were logging to the client. This was a lot of noise and made it difficult to see what was happening.
The PC is still getting stuck in an infinite loop
I have two helpful scripts to debug it
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
馃憤 thanks for taking this on! I've left two non blocking comments and I'll add the logging configuration change directly on top of this branch.
else event.getFormattedMessage | ||
connection.foreach(_.logMessage(MessageType.Log, message)) | ||
// Skip rpc message noise. | ||
if (!event.getLoggerName.startsWith("langserver.core.Message")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be configured moreflexibly in logback.groovy
. I'll push this change directly on the PR.
@@ -325,21 +318,6 @@ object ScalametaLanguageServer extends LazyLogging { | |||
subscriber -> semanticdbPublisher | |||
} | |||
|
|||
def interactiveSemanticdbStream(cwd: AbsolutePath)( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you remove this entirely because you think there's a better approach? Otherwise just commenting/removing the code that invokes this should be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think There may be a better way to model this as a stream from the notifications, want to experiment with it today
@@ -13,3 +13,5 @@ appender("LSP", scala.meta.languageserver.LSPLogger) { | |||
} | |||
|
|||
root(DEBUG, ["LSP", "STDOUT"]) | |||
logger("langserver.core.MessageWriter", INFO, ["LSP", "STDOUT"]) | |||
logger("langserver.core.MessageReader", INFO, ["LSP", "STDOUT"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@olafurpg this should be easier to tweak. I've opted for raising the level to INFO
, since the noisy RPC messages have a DEBUG level.
The combination of #104 #103 and #100 made the server almost unusable. This PR tries to repair a bit of the damage by
Scheduler
instead of main thread. Commands were accidentally running on the main thread because I usedTask.now
馃槄 . Notifications were also blocking the main thread because we compile on every change after Produce a stream of semanticdbs as you type聽#100.