-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
forceFlush() and shutdown() operations hang, not honoring timeout when there is no network connection for whole session #449
Comments
Hi @dpasirst, |
Hi @bryce-b , Short version: it still hangs with Some additional details: #if DEBUG
let spanProcessor = SimpleSpanProcessor(spanExporter: traceExporter)
#else
let spanProcessor = BatchSpanProcessor(spanExporter: traceExporter)
#endif However, modifying it to use BTW: func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
} |
Thanks for bringing this to our attention. I'll try to get this fixed asap. |
Negative, this issue should not be closed. It is not fixed. I just tested using main and can confirm that it still hangs indefinitely with both BatchSpanProcessor and the BatchLogRecordProcessor. span shutdown log shutdown In exportBatch(), line 129 is the btw: it would be much nicer if in addition to this working, if |
I've discovered that this is only an issue on macos, and not iOS, which is why I initially thought it solved. |
@bryce-b However - those numbers did not change when a timeout was specified. let tracerProviderSDK = OpenTelemetry.instance.tracerProvider as? TracerProviderSdk
tracerProviderSDK?.forceFlush(timeout: 3) resulted in taking about 10 seconds, the same amount of time as calling Thus, it does not appear to be honoring the timeout passed into forceFlush. That said, this is a huge leap forward and while I would like to see this fully functioning as expected before closing this issue, I would happily take a release with this behavior over what is released today. |
Alright, I've expanded the exporters to allow for explicitTimeouts. |
When attempting to either
forceFlush()
orshutdown()
the traceProvider instance or LogRecordProcessors such that no network connection to the OpenTelemetry Collector endpoint was present from launch to exit, the respective function calls seemingly hang and do not honor the configured or specified timeouts as called for in the OpenTelemetry specification.Environment:
macOS 13.4.1, OpenTelemetry endpoint is configured with https/TLS. OpenTelemetry-swift 1.5.1. Xcode building native macOS application.
Either - network is disabled on the MacBook from application launch through application exit (or network is operational but collector endpoint is unreachable from application launch through exit).
Note: if the collector was reachable when the application launched and then became unreachable upon application exit, the functions appear to behave as expected.
Simplified Example:
Actual Result:
The application hangs and fails to exit.
Expected result:
The timeout (default or explicit) should be honored per the specification for shutdown() and forceFlush().
Other Notes:
I have not tried or tested Metrics and do not know if that is also impacted.
The text was updated successfully, but these errors were encountered: