Skip to content

[BUG]: JvmBridge registering CLR garbage collector threads with JvmThreadPoolGC #1002

Open
@suhsteve

Description

@suhsteve

Describe the bug
When the finalizer is called for CLR JvmObjectId objects, it calls the rm DotnetBackend method and this calls goes through the JvmBridge class. Because the rm call goes through JvmBridge.CallJavaMethod code path, it gets registered with JvmThreadPoolGC.TryAddThread.

Although this GC thread gets registered on the CLR side by the finalizer call, when the rm is handled by DotnetBackendHandler, it does not run in a org.apache.spark.api.dotnet.ThreadPool. On the CLR side there is a timer associated with JvmThreadPoolGC and when it runs, it attempts to call rmThread on any non-active threads. Because the finalizer's rm JVM call did not run in a org.apache.spark.api.dotnet.ThreadPool, the Java DotnetBackendHandler "rmThread" call will log an error and the CLR JvmThreadPoolGC will log a warning.

Although this won't cause applications to fail, it makes extra calls to the DotnetBackend as well as produce warning and error log lines which is not a good experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions