From b4b3856e29c9a2d82ce3e9ac8499a5bf96d00821 Mon Sep 17 00:00:00 2001 From: Joe George Date: Fri, 24 Oct 2025 14:04:08 -0400 Subject: [PATCH 01/12] Print ios controller log if boot hangs --- scripts/Util.py | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/scripts/Util.py b/scripts/Util.py index b9d81d669b6..c47d39e6c97 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -2743,6 +2743,7 @@ def __init__(self, current): RemoteProcessController.__init__(self, current, "") self.simulatorID = None self.runtimeID = None + self.controllerProcesses = {} # Pick the last iOS simulator runtime ID in the list of iOS simulators (assumed to be the latest). try: sys.stdout.write("searching for latest iOS simulator runtime... ") @@ -2819,24 +2820,40 @@ def startControllerApp(self, current, ident): run('xcrun simctl install "{0}" "{1}"'.format(self.device, appFullPath)) print("ok") + logStreamProcess = subprocess.Popen( + [ + "xcrun", + "simctl", + "spawn", + "booted", + "log", + "stream", + "--level", + "debug", + "--predicate", + f'subsystem contains "{ident.name}"', + ], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + ) + sys.stdout.write("launching {0}... ".format(os.path.basename(appFullPath))) sys.stdout.flush() - n = 0 - while n < 5: - try: - subprocess.run(["xcrun", "simctl", "launch", self.device, ident.name], check=True, timeout=60) - break - except subprocess.TimeoutExpired: - n += 1 - sys.stdout.write(f"\nlaunch timeout, retrying {n}/5... ") - sys.stdout.flush() + try: + subprocess.run(["xcrun", "simctl", "launch", self.device, ident.name], check=True, timeout=60) + except subprocess.TimeoutExpired as ex: + logStreamProcess.terminate() + output = logStreamProcess.stdout.readlines() + print(output) + raise RuntimeError(f"timed out launching controller app: {ex}") from ex + # No "ok" as the command prints its own output def restartControllerApp(self, current, ident): # We reboot the simulator if the controller fails to start. Terminating the controller app # with simctl terminate doesn't always work, it can hang if the controller app died because # of the springboard watchdog. - run('xcrun simctl shutdown "{0}"'.format(self.device)) + run('xcown "{0}"'.format(self.device)) nRetry = 0 while nRetry < 20: try: @@ -2845,7 +2862,8 @@ def restartControllerApp(self, current, ident): except Exception: time.sleep(1.0) nRetry += 1 - run('xcrun simctl launch "{0}" {1}'.format(self.device, ident.name)) + + subprocess.run(["xcrun", "simctl", "launch", self.device, ident.name], check=True, timeout=60) def stopControllerApp(self, ident): controllerBundleIdentifier = ident.name From 7f52a24698106cea9d3d804fab3a3d293b033982 Mon Sep 17 00:00:00 2001 From: Joe George Date: Fri, 24 Oct 2025 14:12:16 -0400 Subject: [PATCH 02/12] run ci on branch --- .github/workflows/ci.yml | 164 +++++++++++++++++++-------------------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34ac0df44f9..f8384a67daf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,10 +3,10 @@ name: CI on: workflow_dispatch: push: - branches: ["main"] - pull_request: - # The branches below must be a subset of the branches above - branches: ["main"] + # branches: ["main"] + # pull_request: + # # The branches below must be a subset of the branches above + # branches: ["main"] # See https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: @@ -20,58 +20,58 @@ jobs: fail-fast: false matrix: include: - # Release builds - - os: macos-26 - config: "release" - # We want to test C++ and Swift only (in each direction) - cross_test_flags: "--all-cross --filter cpp --filter swift" - python_tests: true - - os: ubuntu-24.04 - config: "release" - cross_test_flags: "--all-cross" - - os: ubuntu-24.04-arm - config: "release" - build_flags: "SKIP=csharp" # Skip C# on ARM as .NET compiler keeps crashing - test_flags: "--rfilter=csharp" - python_tests: true - - os: windows-2022 - config: "release" - build_flags: "/p:Platform=x64" - test_flags: "--platform=x64" - python_tests: true - - os: windows-2022 - config: "cpp-win32-release" - working_directory: "cpp" - build_flags: "/p:Platform=Win32" - msbuild_project: "msbuild/ice.proj" - test_flags: "--platform=Win32" - python_tests: true - - os: windows-2025 - config: "release" - build_flags: "/p:Platform=x64" - test_flags: "--platform=x64" - python_tests: true - - # Debug builds - - os: macos-26 - config: "debug" - build_flags: "OPTIMIZE=no" - test_flags: "--swift-config=debug --csharp-config=Debug" - python_tests: true - - os: ubuntu-24.04 - config: "debug" - build_flags: "OPTIMIZE=no" - test_flags: "--csharp-config=Debug" - python_tests: true - - # TODO - figure out how to properly install debug Python - - os: windows-2022 - config: "debug" - working_directory: "cpp" - build_flags: "/p:Platform=x64 /p:Configuration=Debug" - test_flags: "--platform=x64 --config=Debug" - msbuild_project: "msbuild/ice.proj" - python_tests: true + # # Release builds + # - os: macos-26 + # config: "release" + # # We want to test C++ and Swift only (in each direction) + # cross_test_flags: "--all-cross --filter cpp --filter swift" + # python_tests: true + # - os: ubuntu-24.04 + # config: "release" + # cross_test_flags: "--all-cross" + # - os: ubuntu-24.04-arm + # config: "release" + # build_flags: "SKIP=csharp" # Skip C# on ARM as .NET compiler keeps crashing + # test_flags: "--rfilter=csharp" + # python_tests: true + # - os: windows-2022 + # config: "release" + # build_flags: "/p:Platform=x64" + # test_flags: "--platform=x64" + # python_tests: true + # - os: windows-2022 + # config: "cpp-win32-release" + # working_directory: "cpp" + # build_flags: "/p:Platform=Win32" + # msbuild_project: "msbuild/ice.proj" + # test_flags: "--platform=Win32" + # python_tests: true + # - os: windows-2025 + # config: "release" + # build_flags: "/p:Platform=x64" + # test_flags: "--platform=x64" + # python_tests: true + + # # Debug builds + # - os: macos-26 + # config: "debug" + # build_flags: "OPTIMIZE=no" + # test_flags: "--swift-config=debug --csharp-config=Debug" + # python_tests: true + # - os: ubuntu-24.04 + # config: "debug" + # build_flags: "OPTIMIZE=no" + # test_flags: "--csharp-config=Debug" + # python_tests: true + + # # TODO - figure out how to properly install debug Python + # - os: windows-2022 + # config: "debug" + # working_directory: "cpp" + # build_flags: "/p:Platform=x64 /p:Configuration=Debug" + # test_flags: "--platform=x64 --config=Debug" + # msbuild_project: "msbuild/ice.proj" + # python_tests: true # iOS - os: macos-26 @@ -81,32 +81,32 @@ jobs: test_flags: "--languages='cpp,swift' --config=debug --platform=iphonesimulator --controller-app --rfilter=swift/Ice/udp" build_cpp_and_python: true - # Static builds - - os: ubuntu-24.04 - config: "static" - build_flags: "CONFIGS=static" - test_flags: "--config=static --filter=Ice/ --filter=IceDiscovery/" - working_directory: "cpp" - - # MATLAB - - os: ubuntu-24.04 - config: "matlab" - working_directory: "matlab" - build_cpp_and_python: true - - os: windows-2022 - config: "matlab" - working_directory: "matlab" - build_flags: "/p:Platform=x64" - msbuild_project: "msbuild/ice.proj" - test_flags: "--platform=x64" - build_cpp_and_python: true - - - os: ubuntu-24.04 - config: "android" - working_directory: "java" - test_flags: "--android --controller-app" - build_cpp_and_python: true - build_android_controller: true + # # Static builds + # - os: ubuntu-24.04 + # config: "static" + # build_flags: "CONFIGS=static" + # test_flags: "--config=static --filter=Ice/ --filter=IceDiscovery/" + # working_directory: "cpp" + + # # MATLAB + # - os: ubuntu-24.04 + # config: "matlab" + # working_directory: "matlab" + # build_cpp_and_python: true + # - os: windows-2022 + # config: "matlab" + # working_directory: "matlab" + # build_flags: "/p:Platform=x64" + # msbuild_project: "msbuild/ice.proj" + # test_flags: "--platform=x64" + # build_cpp_and_python: true + + # - os: ubuntu-24.04 + # config: "android" + # working_directory: "java" + # test_flags: "--android --controller-app" + # build_cpp_and_python: true + # build_android_controller: true runs-on: ${{ matrix.os }} steps: From 77ea2db51462d97a19042080e3d8f14fa7357e32 Mon Sep 17 00:00:00 2001 From: Joe George Date: Fri, 24 Oct 2025 14:51:50 -0400 Subject: [PATCH 03/12] fix --- scripts/Util.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/Util.py b/scripts/Util.py index c47d39e6c97..628b9b5c890 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -2743,7 +2743,6 @@ def __init__(self, current): RemoteProcessController.__init__(self, current, "") self.simulatorID = None self.runtimeID = None - self.controllerProcesses = {} # Pick the last iOS simulator runtime ID in the list of iOS simulators (assumed to be the latest). try: sys.stdout.write("searching for latest iOS simulator runtime... ") @@ -2853,7 +2852,7 @@ def restartControllerApp(self, current, ident): # We reboot the simulator if the controller fails to start. Terminating the controller app # with simctl terminate doesn't always work, it can hang if the controller app died because # of the springboard watchdog. - run('xcown "{0}"'.format(self.device)) + run('xcrun simctl shutdown "{0}"'.format(self.device)) nRetry = 0 while nRetry < 20: try: From 021005c8ffe40cfeffe47cf167fad6120688235f Mon Sep 17 00:00:00 2001 From: Joe George Date: Mon, 27 Oct 2025 14:52:29 -0400 Subject: [PATCH 04/12] 5 -> 10 --- scripts/Util.py | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/scripts/Util.py b/scripts/Util.py index 628b9b5c890..e7fed2ef503 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -2819,33 +2819,15 @@ def startControllerApp(self, current, ident): run('xcrun simctl install "{0}" "{1}"'.format(self.device, appFullPath)) print("ok") - logStreamProcess = subprocess.Popen( - [ - "xcrun", - "simctl", - "spawn", - "booted", - "log", - "stream", - "--level", - "debug", - "--predicate", - f'subsystem contains "{ident.name}"', - ], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - ) - sys.stdout.write("launching {0}... ".format(os.path.basename(appFullPath))) sys.stdout.flush() - try: - subprocess.run(["xcrun", "simctl", "launch", self.device, ident.name], check=True, timeout=60) - except subprocess.TimeoutExpired as ex: - logStreamProcess.terminate() - output = logStreamProcess.stdout.readlines() - print(output) - raise RuntimeError(f"timed out launching controller app: {ex}") from ex - + n = 0 + while n < 10: + try: + subprocess.run(["xcrun", "simctl", "launch", self.device, ident.name], check=True, timeout=60) + break + except subprocess.TimeoutExpired: + n += 1 # No "ok" as the command prints its own output def restartControllerApp(self, current, ident): From e02fc169c820ab8f33a9c0b81fc24c27cbdd4c8d Mon Sep 17 00:00:00 2001 From: Joe George Date: Tue, 28 Oct 2025 10:08:51 -0400 Subject: [PATCH 05/12] logging --- scripts/Util.py | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/scripts/Util.py b/scripts/Util.py index e7fed2ef503..5fe18fc7525 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -2819,15 +2819,42 @@ def startControllerApp(self, current, ident): run('xcrun simctl install "{0}" "{1}"'.format(self.device, appFullPath)) print("ok") + logStreamProcess = subprocess.Popen( + [ + "xcrun", + "simctl", + "spawn", + "booted", + "log", + "stream", + "--level", + "debug", + # "--predicate", + # f'subsystem contains "{ident.name}"', + ], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + ) + sys.stdout.write("launching {0}... ".format(os.path.basename(appFullPath))) sys.stdout.flush() n = 0 - while n < 10: + while n < 5: try: - subprocess.run(["xcrun", "simctl", "launch", self.device, ident.name], check=True, timeout=60) + subprocess.run(["xcrun", "simctl", "launch", self.device, ident.name], check=True, timeout=120) break except subprocess.TimeoutExpired: n += 1 + + print(f"ok with {n + 1} attempts") + logStreamProcess.terminate() + + if n == 5: + output = logStreamProcess.stdout.readlines() + with open("ios_simulator.log", "wb") as f: + for line in output: + f.write(line) + raise RuntimeError("failed to launch the controller application") # No "ok" as the command prints its own output def restartControllerApp(self, current, ident): From 845c1366ee17ecc45d95f49ec0db5c86f73df9ca Mon Sep 17 00:00:00 2001 From: Joe George Date: Tue, 28 Oct 2025 11:03:26 -0400 Subject: [PATCH 06/12] ok --- scripts/Util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Util.py b/scripts/Util.py index 5fe18fc7525..f1e062c59b3 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -2846,7 +2846,7 @@ def startControllerApp(self, current, ident): except subprocess.TimeoutExpired: n += 1 - print(f"ok with {n + 1} attempts") + print(f"ok ({n} retries)") logStreamProcess.terminate() if n == 5: From 784bc24706e92ef8e08a3d0a2cfc99387e7e2e41 Mon Sep 17 00:00:00 2001 From: Joe George Date: Wed, 29 Oct 2025 10:22:17 -0400 Subject: [PATCH 07/12] fix --- swift/test/Ice/location/TestI.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/test/Ice/location/TestI.swift b/swift/test/Ice/location/TestI.swift index df9d573859e..99724b7866a 100644 --- a/swift/test/Ice/location/TestI.swift +++ b/swift/test/Ice/location/TestI.swift @@ -187,7 +187,7 @@ actor ServerLocator: TestLocator { return try await _registry.getObject(id) } - func getRegistry(current _: Ice.Current) -> Ice.LocatorRegistryPrx? { + nonisolated func getRegistry(current _: Ice.Current) -> Ice.LocatorRegistryPrx? { return _registryPrx } From 2521aea167626a9c92267d4fe1bb12053e460d13 Mon Sep 17 00:00:00 2001 From: Joe George Date: Wed, 29 Oct 2025 13:07:53 -0400 Subject: [PATCH 08/12] tracing --- swift/test/Ice/location/Server.swift | 3 +++ swift/test/Ice/location/TestI.swift | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/swift/test/Ice/location/Server.swift b/swift/test/Ice/location/Server.swift index 0363b9ca870..e1413fe53c5 100644 --- a/swift/test/Ice/location/Server.swift +++ b/swift/test/Ice/location/Server.swift @@ -11,7 +11,10 @@ class Server: TestHelperI, @unchecked Sendable { // 'server'(a server isn't a different process, it's just a new // communicator and object adapter). // + let properties = try createTestProperties(args) + properties.setProperty(key: "Ice.Trace.Dispatch", value: "1") + properties.setProperty(key: "Ice.Trace.Network", value: "3") properties.setProperty(key: "Ice.ThreadPool.Server.Size", value: "2") let communicator = try initialize(Ice.InitializationData(properties: properties)) defer { diff --git a/swift/test/Ice/location/TestI.swift b/swift/test/Ice/location/TestI.swift index 99724b7866a..9a6ea9345ae 100644 --- a/swift/test/Ice/location/TestI.swift +++ b/swift/test/Ice/location/TestI.swift @@ -67,12 +67,17 @@ actor ServerManagerI: ServerManager { _properties.setProperty(key: "Ice.PrintAdapterReady", value: "0") } - func startServer(current _: Ice.Current) async throws { + func startServer(current: Ice.Current) async throws { + + let startTime = CFAbsoluteTimeGetCurrent() for c in _communicators { - c.waitForShutdown() + await c.shutdownCompleted() c.destroy() } _communicators.removeAll() + let endTime = CFAbsoluteTimeGetCurrent() + current.adapter.getCommunicator().getLogger().print( + "Previous servers shutdown took \(endTime - startTime) seconds") // // Simulate a server: create a new communicator and object From 6a0a4ccb111ee669dfdc6f14ee78ef67fd37878d Mon Sep 17 00:00:00 2001 From: Joe George Date: Wed, 29 Oct 2025 15:42:38 -0400 Subject: [PATCH 09/12] more --- swift/test/Ice/location/Server.swift | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/swift/test/Ice/location/Server.swift b/swift/test/Ice/location/Server.swift index e1413fe53c5..5b5b273e05a 100644 --- a/swift/test/Ice/location/Server.swift +++ b/swift/test/Ice/location/Server.swift @@ -1,9 +1,25 @@ // Copyright (c) ZeroC, Inc. -import Dispatch import Ice import TestCommon + +struct DispatchWrapper: Dispatcher { + let dispatcher: Dispatcher + + func dispatch(_ request: sending IncomingRequest) async throws -> OutgoingResponse { + let startTime = ContinuousClock.now + let response = try await dispatcher.dispatch(request) + let endTime = ContinuousClock.now + let elapsed = startTime.duration(to: endTime) + + let logger = request.current.adapter.getCommunicator().getLogger() + logger.print("Swift Dispatch: identity=\(request.current.id) operation=\(request.current.operation) duration=\(Double(elapsed.components.attoseconds) / 1_000_000_000_000_000.0) ms") + + return response + } +} + class Server: TestHelperI, @unchecked Sendable { override public func run(args: [String]) async throws { // @@ -13,8 +29,6 @@ class Server: TestHelperI, @unchecked Sendable { // let properties = try createTestProperties(args) - properties.setProperty(key: "Ice.Trace.Dispatch", value: "1") - properties.setProperty(key: "Ice.Trace.Network", value: "3") properties.setProperty(key: "Ice.ThreadPool.Server.Size", value: "2") let communicator = try initialize(Ice.InitializationData(properties: properties)) defer { @@ -35,7 +49,7 @@ class Server: TestHelperI, @unchecked Sendable { // Make sure we use a separate copy of the properties as the servant modifies them. let object = ServerManagerI(registry: registry, properties: properties.clone(), helper: self) - try adapter.add(servant: object, id: Ice.stringToIdentity("ServerManager")) + try adapter.add(servant: DispatchWrapper(dispatcher: object), id: Ice.stringToIdentity("ServerManager")) try await registry.addObject(adapter.createProxy(Ice.stringToIdentity("ServerManager"))) let registryPrx = try uncheckedCast( @@ -45,7 +59,7 @@ class Server: TestHelperI, @unchecked Sendable { type: Ice.LocatorRegistryPrx.self) let locator = ServerLocator(registry: registry, registryPrx: registryPrx) - try adapter.add(servant: locator, id: Ice.stringToIdentity("locator")) + try adapter.add(servant: DispatchWrapper(dispatcher: locator), id: Ice.stringToIdentity("locator")) try adapter.activate() serverReady() From d6b74762113d8cc2d46d5ea3fdb74cc148f4bcca Mon Sep 17 00:00:00 2001 From: Joe George Date: Wed, 29 Oct 2025 15:58:58 -0400 Subject: [PATCH 10/12] cleanup --- swift/test/Ice/location/TestI.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/swift/test/Ice/location/TestI.swift b/swift/test/Ice/location/TestI.swift index 9a6ea9345ae..657c76b739b 100644 --- a/swift/test/Ice/location/TestI.swift +++ b/swift/test/Ice/location/TestI.swift @@ -123,12 +123,10 @@ actor ServerManagerI: ServerManager { try adapter2.setLocator(uncheckedCast(prx: locator, type: Ice.LocatorPrx.self)) let object = try TestI(adapter1: adapter, adapter2: adapter2, registry: _registry) - try await _registry.addObject(adapter.add(servant: HelloI(), id: Ice.stringToIdentity("hello"))) - try await _registry.addObject(adapter.add(servant: object, id: Ice.Identity(name: "test"))) - try await _registry.addObject(adapter.add(servant: object, id: Ice.stringToIdentity("test2"))) + try await _registry.addObject(adapter.add(servant: object, id: Ice.Identity(name: "test2"))) - _ = try adapter.add(servant: object, id: Ice.stringToIdentity("test3")) + _ = try adapter.add(servant: object, id: Ice.Identity(name: "test3")) try adapter.activate() try adapter2.activate() From 1ecec4ad79f99e5157b494a652c7d2475cb3a8d4 Mon Sep 17 00:00:00 2001 From: Joe George Date: Thu, 30 Oct 2025 10:17:38 -0400 Subject: [PATCH 11/12] fixez --- swift/src/IceImpl/DispatchAdapter.mm | 36 ++++++++++++++++++++++++++++ swift/test/Ice/location/TestI.swift | 1 + 2 files changed, 37 insertions(+) diff --git a/swift/src/IceImpl/DispatchAdapter.mm b/swift/src/IceImpl/DispatchAdapter.mm index 1487389c6c5..f24d074cfef 100644 --- a/swift/src/IceImpl/DispatchAdapter.mm +++ b/swift/src/IceImpl/DispatchAdapter.mm @@ -6,12 +6,39 @@ #import "include/LocalExceptionFactory.h" #import "include/ObjectAdapter.h" +#include + +namespace +{ + std::string timePointToString(const std::chrono::system_clock::time_point& timePoint) + { + auto time = std::chrono::system_clock::to_time_t(timePoint); + struct tm tr; + + localtime_r(&time, &tr); + + char buf[32]; + strftime(buf, sizeof(buf), "%x %H:%M:%S", &tr); + + auto usec = std::chrono::duration_cast(timePoint.time_since_epoch()); + return std::string(buf) + "." + std::to_string(usec.count() % 1000000 / 1000); + } +} + void CppDispatcher::dispatch(Ice::IncomingRequest& request, std::function sendResponse) { // Captured as a const copy by the block according to https://clang.llvm.org/docs/BlockLanguageSpec.html Ice::Current current{request.current()}; + auto logger = current.adapter->getCommunicator()->getLogger(); + + auto startTime = std::chrono::system_clock::now(); + + logger->print( + "C++ Dispatch into Swift: time=" + timePointToString(startTime) + " identity=" + current.id.name + + " operation=" + current.operation + " start time"); + int32_t sz; const std::byte* inEncaps; std::function cleanup; @@ -49,6 +76,12 @@ ICEOutgoingResponse outgoingResponse = ^(uint8_t replyStatus, NSString* exceptionId, NSString* exceptionDetails, const void* message, long count) { + auto endTime = std::chrono::system_clock::now(); + logger->print( + "C++ Dispatch completed: time=" + timePointToString(endTime) + " identity=" + current.id.name + + " operation=" + current.operation + " duration=" + + std::to_string(std::chrono::duration_cast(endTime - startTime).count()) + + " ms"); cleanup(); // We need to copy the message here as we don't own the memory and it can be sent asynchronously. @@ -61,6 +94,9 @@ fromNSString(exceptionDetails), std::move(ostr), current}); + logger->print( + "Swift Dispatch: time=" + timePointToString(std::chrono::system_clock::now()) + + " identity=" + current.id.name + " operation=" + current.operation + " response sent"); }; ICEObjectAdapter* adapter = [ICEObjectAdapter getHandle:current.adapter]; diff --git a/swift/test/Ice/location/TestI.swift b/swift/test/Ice/location/TestI.swift index 657c76b739b..c987b1b7ce4 100644 --- a/swift/test/Ice/location/TestI.swift +++ b/swift/test/Ice/location/TestI.swift @@ -123,6 +123,7 @@ actor ServerManagerI: ServerManager { try adapter2.setLocator(uncheckedCast(prx: locator, type: Ice.LocatorPrx.self)) let object = try TestI(adapter1: adapter, adapter2: adapter2, registry: _registry) + try await _registry.addObject(adapter.add(servant: HelloI(), id: Ice.Identity(name: "hello"))) try await _registry.addObject(adapter.add(servant: object, id: Ice.Identity(name: "test"))) try await _registry.addObject(adapter.add(servant: object, id: Ice.Identity(name: "test2"))) From 0b6ee4aca1488ac3849d631322b3c4a4f6ca4875 Mon Sep 17 00:00:00 2001 From: Joe George Date: Thu, 30 Oct 2025 11:34:32 -0400 Subject: [PATCH 12/12] fix --- swift/src/Ice/ObjectAdapterI.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/swift/src/Ice/ObjectAdapterI.swift b/swift/src/Ice/ObjectAdapterI.swift index ebffe1e1b95..0b053551965 100644 --- a/swift/src/Ice/ObjectAdapterI.swift +++ b/swift/src/Ice/ObjectAdapterI.swift @@ -234,6 +234,12 @@ final class ObjectAdapterI: LocalObject, ObjectAdapter, ICEDis ) { precondition(handle == adapter) + + let logger = getCommunicator().getLogger() + + logger.print( + "Swift Dispatch started: time=\(Date().formatted(.iso8601.year().month().day().time(includingFractionalSeconds: true))) identity=\(name) operation=\(operation) starting dispatch") + let connection = con?.getSwiftObject(ConnectionI.self) { ConnectionI(handle: con!) } let encoding = EncodingVersion(major: encodingMajor, minor: encodingMinor) @@ -255,17 +261,22 @@ final class ObjectAdapterI: LocalObject, ObjectAdapter, ICEDis let request = IncomingRequest(current: current, inputStream: istr) + logger.print( + "About to start Task: time=\(Date().formatted(.iso8601.year().month().day().time(includingFractionalSeconds: true))) identity=\(name) operation=\(operation) starting dispatch") Task { let response: OutgoingResponse // TODO: the request is in the Task capture and we need to send it. Is there a better syntax? nonisolated(unsafe) let request = request do { + logger.print( + "Dispatching OA request: time=\(Date().formatted(.iso8601.year().month().day().time(includingFractionalSeconds: true))) identity=\(name) operation=\(operation) starting dispatch") response = try await dispatchPipeline.dispatch(request) } catch { response = current.makeOutgoingResponse(error: error) } - + logger.print( + "Completed OA request: time=\(Date().formatted(.iso8601.year().month().day().time(includingFractionalSeconds: true))) identity=\(name) operation=\(operation) dispatch completed, sending response") response.outputStream.finished().withUnsafeBytes { outgoingResponseHandler( response.replyStatus,