Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: disable spark async profiler on non-arm based systems (#1533)
### Motivation The async profiler version bundled with spark (which itself is bundled in modern paper versions) does not support java 23 and causes a seqfault when being executed which crashes at least all modern paper services running on amd64 systems: ``` # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x000079c43ba06ecf, pid=39327, tid=39528 # # JRE version: OpenJDK Runtime Environment (23.0+37) (build 23+37-2369) # Java VM: OpenJDK 64-Bit Server VM (23+37-2369, mixed mode, sharing, tiered, compressed class ptrs, g1 gc, linux-amd64) # Problematic frame: # C [spark-502cce8be50-libasyncProfiler.so.tmp+0x6ecf] NMethod::isNMethod()+0x1f ``` ### Modification Disable the async profiler integration in spark when an old version of the async profiler is used. The detection process of the async profiler version relies on a pull request to spark which is not yet merged (so we might need to change the detection process again when that happened). Additionally the issue does not happen on arm systems, therefore the async profiler is left enabled on these systems. The `load` method of `AsyncProfilerAccess` on matching spark versions is changed so that it always throws an exception that the async profiler is not available. The message of the exception is printed into the console when starting the profiler so that the user is informed why the profiler is disabled: ``` [23:22:44 INFO]: [spark] Starting background profiler... [23:22:44 WARN]: [spark] Unable to initialise the async-profiler engine: this version of spark uses a version of async-profiler which does not support java 23+ [23:22:44 WARN]: [spark] Please see here for more information: https://spark.lucko.me/docs/misc/Using-async-profiler ``` ### Result Non-arm servers that run modern paper versions and all servers running spark with an old version of async-profiler will no longer segfault when starting up/the plugin is enabled.
- Loading branch information