Skip to content

Commit cf48252

Browse files
committed
Log when the 10 year wait that’s parking the main thread expires for some reason
Not sure if this ever happens but if it does, we should log it. Also, just start waiting again for another 10 years.
1 parent e4d8331 commit cf48252

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/sourcekit-lsp/SourceKitLSP.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,10 @@ struct SourceKitLSP: AsyncParsableCommand {
274274
// Park the main function by sleeping for 10 years.
275275
// All request handling is done on other threads and sourcekit-lsp exits by calling `_Exit` when it receives a
276276
// shutdown notification.
277-
try await Task.sleep(for: .seconds(60 * 60 * 24 * 365 * 10))
277+
while true {
278+
try? await Task.sleep(for: .seconds(60 * 60 * 24 * 365 * 10))
279+
logger.fault("10 year wait that's parking the main thread expired. Waiting again.")
280+
}
278281
}
279282
}
280283

0 commit comments

Comments
 (0)