Skip to content

Fix symbol extraction timeout isolation - #3328

Merged
Widthdom merged 5 commits into
mainfrom
fix-issue3048-3047
Jun 6, 2026
Merged

Fix symbol extraction timeout isolation#3328
Widthdom merged 5 commits into
mainfrom
fix-issue3048-3047

Conversation

@Widthdom

@Widthdom Widthdom commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Route symbol extraction through a reusable isolated worker process so extraction timeouts kill the timed-out worker instead of leaving extractor work running in-process.
  • Support framework-dependent, apphost, and single-file/self-contained worker launch paths for symbol extraction and post-extraction hook callbacks.
  • Capture extractor console output inside the worker so stdout cannot corrupt the worker JSON protocol, while stderr diagnostics are forwarded after response parsing.
  • Use source-generated worker JSON contexts so trimmed single-file binaries can serialize worker protocol messages without reflection metadata.
  • Add focused regression coverage and a changelog fragment for full-scan symbol extraction timeouts should ensure extractor tasks stop #3048.

Issues

Fixes #3048

#3047 was already fixed on the fetched origin/main before this branch. I verified the existing hook callback timeout coverage and closed #3047 separately; this PR does not add a separate #3047 fix.

Validation

  • dotnet build CodeIndex.sln -c Release -p:UseSharedCompilation=false
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -c Release --filter "FullyQualifiedName~IndexCommandRunnerTests.PostExtractionHookCallbackWorker_StartInfo_UsesCurrentCdidxExecutableWhenAvailable|FullyQualifiedName~IndexCommandRunnerTests.PostExtractionHookCallbackWorker_StartInfo_UsesFrameworkDependentDllWhenProcessIsNotCdidx|FullyQualifiedName~IndexCommandRunnerTests.SymbolExtractionWorker_StartInfo_UsesCurrentCdidxExecutableWhenAvailable|FullyQualifiedName~IndexCommandRunnerTests.SymbolExtractionWorker_StartInfo_UsesFrameworkDependentDllWhenProcessIsNotCdidx|FullyQualifiedName~IndexCommandRunnerTests.Run_PublishedSingleFileBinary_IndexesWithIsolatedSymbolWorker|FullyQualifiedName~PostExtractionHookTests" -p:UseSharedCompilation=false
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -c Release --filter "FullyQualifiedName~IndexCommandRunnerTests.Run_PublishedSingleFileBinary_IndexesWithIsolatedSymbolWorker|FullyQualifiedName~IndexCommandRunnerTests.Run_FullScanJson_WritesLivenessToStderrOnly" -p:UseSharedCompilation=false
  • dotnet publish src/CodeIndex/CodeIndex.csproj --configuration Debug --runtime osx-arm64 --output /private/tmp/cdidx-singlefile-ci-check -p:PublishTrimmed=true -p:SelfContained=true -p:PublishSingleFile=true -p:UseSharedCompilation=false
  • /private/tmp/cdidx-singlefile-ci-check/cdidx-smoke /private/tmp/cdidx-smoke-project --db /private/tmp/cdidx-smoke-db-sourcegen/index.db --json --force
  • /private/tmp/cdidx-singlefile-ci-check/cdidx-smoke /private/tmp/cdidx-smoke-project --db /private/tmp/cdidx-smoke-db-sourcegen/stdout-stderr.db --json --force >/private/tmp/cdidx-smoke-stdout.json 2>/private/tmp/cdidx-smoke-stderr.txt
  • dotnet build src/CodeIndex/CodeIndex.csproj -c Debug -p:UseSharedCompilation=false
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • dotnet format CodeIndex.sln --verify-no-changes
  • git diff --check
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll index . --files src/CodeIndex/Indexer/Symbols/SymbolExtractionWorker.cs src/CodeIndex/Indexer/Hooks/PostExtractionHookCallbackWorker.cs tests/CodeIndex.Tests/IndexCommandRunnerTests.cs --json
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll index . --commits HEAD --json
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll status --check --json
  • Codex adversarial review: No blocking/actionable issues found.

@Widthdom
Widthdom marked this pull request as ready for review June 6, 2026 17:15
@Widthdom
Widthdom merged commit d3df79b into main Jun 6, 2026
10 checks passed
@Widthdom
Widthdom deleted the fix-issue3048-3047 branch June 6, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

full-scan symbol extraction timeouts should ensure extractor tasks stop post-extraction hook timeouts should stop timed-out callbacks

1 participant