adoroszlai commented on code in PR #9396:
URL: https://github.com/apache/ozone/pull/9396#discussion_r2574617446


##########
hadoop-hdds/common/src/main/conf/ozone-env.sh:
##########
@@ -17,8 +17,24 @@
 
 # Set Ozone-specific environment variables here.
 
-# Enable core dump when crash in C++
-ulimit -c unlimited
+# Enable core dump when crash in C++.
+# Ozone may invoke native components (e.g., RocksDB, JNI, or C++ libraries).
+# When a native crash occurs, enabling core dumps can help debugging.
+#
+# However, raising the core file size limit is not always allowed.
+# - 'ulimit -Hc' returns the hard limit for core size.
+#   If the hard limit is 0, core dumps are explicitly forbidden
+#   (common for non-root users or Docker containers started with
+#   '--ulimit core=0'). In such environments, attempting
+#   'ulimit -c unlimited' would always fail and print a warning.
+#
+# To avoid noisy warnings during CLI execution (e.g., ozone version),
+# we only attempt to raise the limit when the hard limit is non-zero,
+# and we silence any possible error for safety.
+hard=$(ulimit -Hc 2>/dev/null || echo 0)
+if [ "$hard" != 0 ]; then

Review Comment:
   Can this be done without defining a temp variable (which is leaked to 
scripts sourcing this file)?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to