Skip to content

Commit 987779d

Browse files
authored
Merge branch 'main' into changes/rosetta-aot-cache
2 parents 8e8e4db + 5427fd2 commit 987779d

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

Sources/Containerization/Image/ImageStore/ImageStore+ReferenceManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ extension ImageStore {
4949

5050
private func save(_ state: State) throws {
5151
let statePath = self.path.appendingPathComponent("state.json")
52-
try JSONEncoder().encode(state).write(to: statePath)
52+
try JSONEncoder().encode(state).write(to: statePath, options: .atomic)
5353
}
5454

5555
public func delete(reference: String) throws {

Sources/Containerization/LinuxContainer.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,8 @@ extension LinuxContainer {
641641
let vm = try await self.vmm.create(config: creationConfig)
642642
let relayManager = UnixSocketRelayManager(vm: vm, log: self.logger)
643643

644-
try await vm.start()
645644
do {
645+
try await vm.start()
646646
let mountsForAgent = containerMounts
647647
try await vm.withAgent { agent in
648648
try await agent.standardSetup()
@@ -1356,6 +1356,7 @@ extension LinuxContainer {
13561356

13571357
try await withThrowingTaskGroup(of: Void.self) { group in
13581358
group.addTask {
1359+
defer { metadataCont.finish() }
13591360
try await state.vm.withAgent { agent in
13601361
guard let vminitd = agent as? Vminitd else {
13611362
throw ContainerizationError(.unsupported, message: "copyOut requires Vminitd agent")

Sources/Containerization/LinuxProcess.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,8 @@ public final class LinuxProcess: Sendable {
125125

126126
extension LinuxProcess {
127127
func setupIO(listeners: [VsockListener?]) async throws -> [FileHandle?] {
128-
// Nested virtualization (x86_64 CI) is dramatically slower to bring the
129-
// guest vsock listeners up than native arm64 virt, so allow a longer
130-
// window there while keeping the arm64 path tight.
131-
#if arch(x86_64)
132128
let ioTimeout: UInt32 = 30
133-
#else
134-
let ioTimeout: UInt32 = 3
135-
#endif
129+
136130
let handles = try await Timeout.run(seconds: ioTimeout) {
137131
try await withThrowingTaskGroup(of: (Int, FileHandle?).self) { group in
138132
var results = [FileHandle?](repeating: nil, count: 3)

0 commit comments

Comments
 (0)