Skip to content

Commit d811fcf

Browse files
committed
Ensure that we end the Reloading package interval if a call in reloadPackageAssumingOnPackageLoadingQueue throws
If a call in `reloadPackageAssumingOnPackageLoadingQueue` throws, we weren’t getting to the end of it and would thus never end the signpost started within. Move the `endInterval` call up ensure it is always ended. Found this while investigating https://ci-external.swift.org/job/swift-PR-windows/44247/console, which failed SourceKit-LSP testing because PackageA could not be loaded due to ``` Initial package loading: invalid access to C:\Users\swift-ci\jenkins\workspace\swift-PR-windows\build\tmp\lsp-test\924F7085\PackageA\.build\index-build\x86_64-unknown-windows-msvc\debug\MyLibrary.build\output-file-map.json ```
1 parent a85bb22 commit d811fcf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/BuildServerIntegration/SwiftPMBuildServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ package actor SwiftPMBuildServer: BuiltInBuildServer {
389389
)
390390
await testHooks.reloadPackageDidStart?()
391391
defer {
392+
signposter.endInterval("Reloading package", state)
392393
Task {
393394
self.connectionToSourceKitLSP.send(
394395
TaskFinishNotification(taskId: TaskId(id: "package-reloading"), status: .ok)
@@ -456,7 +457,6 @@ package actor SwiftPMBuildServer: BuiltInBuildServer {
456457
signposter.emitEvent("Finished traversing modules", id: signpostID)
457458

458459
connectionToSourceKitLSP.send(OnBuildTargetDidChangeNotification(changes: nil))
459-
signposter.endInterval("Reloading package", state)
460460
}
461461

462462
package nonisolated var supportsPreparationAndOutputPaths: Bool { options.backgroundIndexingOrDefault }

0 commit comments

Comments
 (0)