Skip to content

Commit 32c2ef6

Browse files
authored
fix(amazonq): avoid workspace index process failure (#5595)
Orphaned http request that should be rejected somehow sneaked into the http request event loop while the FAISS index is not ready, causing the workspace LSP process to terminate, which causes the JetBrains IDE to re-initialize the workspace LSP process, which further triggers an infinite loop of log storm that caused slowness (the log loop issue is fixed in #5581). Here are the sequence of events that happened: 1. JB starts workspace LSP, the LSP then works on tree sitter parsing to generate repomap. 2. When #1 is in progress, client (user) uses @workspace feature sends a request for vector index query. #1 is usually fast but for 1.4GB repo like https://github.com/elastic/elasticsearch (1.4GB), it takes 6 min. 3. Node js event loop busy, client request #2 is timed out. However, requests is cached at server and it becomes an Orphaned http request. 4. The moment when tree sitter parsing is done, node js event loop SOMEHOW immediately handles the Orphaned request in step 2 at a certain possibility! 5. The vector index is not undefined, it was partially initialized, but it had no chunk inside, query when 0 chunks caused Faiss to crash, which terminated the LSP process. 6. JB saw java.net.ConnectException: Connection refused, it then forces LSP to restart, which restarts the indexing, causing performance issue.
1 parent fca5e2f commit 32c2ef6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Fix workspace index process quits when hitting a race condition"
4+
}

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/project/manifest/ManifestManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import software.aws.toolkits.jetbrains.core.getTextFromUrl
1515

1616
class ManifestManager {
1717
private val cloudFrontUrl = "https://aws-toolkit-language-servers.amazonaws.com/q-context/manifest.json"
18-
val currentVersion = "0.1.46"
18+
val currentVersion = "0.1.49"
1919
val currentOs = getOs()
2020
private val arch = CpuArch.CURRENT
2121
private val mapper = jacksonObjectMapper()

0 commit comments

Comments
 (0)