Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions changelog.d/unreleased/1736.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
category: fixed
issues:
- 1736
- 1737
- 1738
- 1742
affected:
- src/CodeIndex/Mcp/McpServer.cs
- tests/CodeIndex.Tests/McpServerTests.cs
---

## English

- **MCP server shutdown and request handling now have stronger concurrency guards (#1736, #1737, #1738, #1742)** — request processing now has a bounded timeout response, shared text-writer output is serialized, EOF drains in-flight stdio work with a grace period, and the run-loop flag uses volatile visibility.

## 日本語

- **MCP server の shutdown と request handling の concurrency guard を強化しました (#1736, #1737, #1738, #1742)** — request 処理は bounded timeout response を返し、共有 TextWriter 出力を直列化し、EOF 時は stdio の in-flight 処理を猶予付きで drain し、run-loop flag は volatile visibility を使うようになりました。
5 changes: 4 additions & 1 deletion src/CodeIndex/Database/DbWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,10 @@ ON CONFLICT(path) DO UPDATE SET
cmd.Parameters["@checksum"].Value = (object?)file.Checksum ?? DBNull.Value;
cmd.Parameters["@modified"].Value = file.Modified;
cmd.Parameters["@generated"].Value = file.Generated ? 1 : 0;
return (long)cmd.ExecuteScalar()!;
using var reader = cmd.ExecuteReader();
if (!reader.Read())
throw new InvalidOperationException("SQLite RETURNING id produced no row for file upsert.");
return reader.GetInt64(0);
}
finally
{
Expand Down
Loading
Loading