smengcl opened a new pull request, #10997:
URL: https://github.com/apache/ozone/pull/10997

   Generated-by: Claude Code (Opus 4.8)
   
   ## What changes were proposed in this pull request?
   
   `HttpServer2.setHttpBaseDir()` creates the temporary HTTP base directory 
under the process current working directory when `ozone.http.basedir` is unset:
   
   ```java
   File tmpMetaDir = Files.createTempDirectory(Paths.get(""), 
"ozone_http_tmp_base_dir").toFile();
   ```
   
   `Paths.get("")` resolves to the process working directory. When that 
directory is not writable by the running uid, `Files.createTempDirectory` 
throws `AccessDeniedException`, which `GenericCli` reports as `Access denied: 
...` and the process exits.
   
   S3 Gateway is the service that hits this: `Gateway.call()` invokes the 
static `setHttpBaseDir()` at startup, before its HTTP servers are constructed. 
In the `kubernetes` acceptance check the s3g statefulset sets no `workingDir` 
and no `runAsUser`, so the working directory is the runner image working 
directory; when it is not writable the s3g pod CrashLoopBackOffs at startup, 
before serving anything. SCM, OM, Recon and Datanode are not affected: they do 
not call the static helper, and `BaseHttpServer` resolves an unset 
`ozone.http.basedir` to `${ozone.metadata.dirs}/webserver` on a writable 
volume. The docker-compose environments are not affected because they set 
`ozone.http.basedir=/tmp/ozone_http` explicitly.
   
   This changes `setHttpBaseDir()` to create the temporary base directory under 
`java.io.tmpdir` (`Files.createTempDirectory("ozone_http_tmp_base_dir")`), 
which is writable by contract, so startup no longer depends on the working 
directory being writable. Freon uses the same helper and benefits from the same 
fix.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16156
   
   ## How was this patch tested?
   
   Added `TestHttpServer2#testSetHttpBaseDirUsesSystemTempDir`, which asserts 
that the resolved base directory exists and is located under `java.io.tmpdir`. 
Ran the new test and `checkstyle` on the `framework` module locally; both pass.
   


-- 
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