Skip to content

Commit 9af5da8

Browse files
committed
fix(workers): Also show ORT stacktraces for forked processes
ORT Server always enable the stacktraces from ORT. However, when a worker process is forked (e.g. when the Analyzer work has environment variables to set) the new JVM does not have this property set. Therefore, this commit also enabled the stacktraces for the forked process. Please note that, since ORT does a call to `printStackTrace()` which outputs to STDERR, the stacktrace is not visible in the logs downloadable from the UI. Signed-off-by: Nicolas Nobelis <[email protected]>
1 parent 33605fa commit 9af5da8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

workers/common/src/main/kotlin/env/EnvironmentForkHelper.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import org.eclipse.apoapsis.ortserver.workers.common.auth.OrtServerAuthenticator
3535
import org.eclipse.apoapsis.ortserver.workers.common.auth.credentialResolver
3636
import org.eclipse.apoapsis.ortserver.workers.common.auth.infraSecretResolverFromConfig
3737
import org.eclipse.apoapsis.ortserver.workers.common.context.WorkerOrtConfig
38+
import org.eclipse.apoapsis.ortserver.workers.common.enableOrtStackTraces
3839

3940
import org.slf4j.LoggerFactory
4041
import org.slf4j.MDC
@@ -101,6 +102,9 @@ object EnvironmentForkHelper {
101102

102103
val netrcManager = NetRcManager.create(credentialResolver(authInfo))
103104
authenticator.updateAuthenticationListener(netrcManager)
105+
106+
logger.info("Enabling ORT stack traces for the AnalyzerRunner forked process.")
107+
enableOrtStackTraces()
104108
}
105109

106110
/**

0 commit comments

Comments
 (0)