adonis0147 opened a new pull request, #13714: URL: https://github.com/apache/doris/pull/13714
# Proposed changes ~~Issue Number: close #xxx~~ ## Problem summary Previously, there are some issues with BE (built with Java UDF support) on macOS and we disable it by default (#13563). Now, all issues are resolved. 1. `ulimit -n` doesn't work. **Root cause** `RLIMIT_NOFILE` will be assigned the minimum of OPEN_MAX (10240) and rlim_cur when create a Java VM. **openjdk (tag: jdk-11+16)** _src/hotspot/os/bsd/os_bsd.cpp_ ```cpp jint os::init_2(void) { os::Posix::init_2(); // initialize suspend/resume support - must do this before signal_sets_init() if (SR_initialize() != 0) { perror("SR_initialize failed"); return JNI_ERR; } Bsd::signal_sets_init(); Bsd::install_signal_handlers(); // Initialize data for jdk.internal.misc.Signal if (!ReduceSignalUsage) { jdk_misc_signal_init(); } // Check and sets minimum stack sizes against command line options if (Posix::set_minimum_stack_sizes() == JNI_ERR) { return JNI_ERR; } if (MaxFDLimit) { // set the number of file descriptors to max. print out error // if getrlimit/setrlimit fails but continue regardless. struct rlimit nbr_files; int status = getrlimit(RLIMIT_NOFILE, &nbr_files); if (status != 0) { log_info(os)("os::init_2 getrlimit failed: %s", os::strerror(errno)); } else { nbr_files.rlim_cur = nbr_files.rlim_max; #ifdef __APPLE__ // Darwin returns RLIM_INFINITY for rlim_max, but fails with EINVAL if // you attempt to use RLIM_INFINITY. As per setrlimit(2), OPEN_MAX must // be used instead nbr_files.rlim_cur = MIN(OPEN_MAX, nbr_files.rlim_cur); #endif status = setrlimit(RLIMIT_NOFILE, &nbr_files); if (status != 0) { log_info(os)("os::init_2 setrlimit failed: %s", os::strerror(errno)); } } } ... ``` Here `MaxFDLimit` is true by default. **Solution** Disable `MaxFDLimit` on macOS. 2. Core dump when use lldb to debug. Environment variable `DORIS_JNI_CLASSPATH_PARAMETER` should be set before BE starts and BE use this variable to get the classpath needed by JVM. We can provide a workaround. If `DORIS_JNI_CLASSPATH_PARAMETER` is unset, we scan the `${DORIS_HOME}/lib` to get the jars and produce the clsspath. ## Checklist(Required) 1. Does it affect the original behavior: - [ ] Yes - [ ] No - [ ] I don't know 4. Has unit tests been added: - [ ] Yes - [ ] No - [ ] No Need 5. Has document been added or modified: - [ ] Yes - [ ] No - [ ] No Need 6. Does it need to update dependencies: - [ ] Yes - [ ] No 7. Are there any changes that cannot be rolled back: - [ ] Yes (If Yes, please explain WHY) - [ ] No ## Further comments If this is a relatively large or complex change, kick off the discussion at [d...@doris.apache.org](mailto:d...@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc... -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org