[ 
https://issues.apache.org/jira/browse/HDDS-13069?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18059011#comment-18059011
 ] 

Attila Doroszlai edited comment on HDDS-13069 at 2/17/26 7:56 AM:
------------------------------------------------------------------

[~sarvekshayr], as a workaround, should we catch the exception from 
{{contentServer.stop()}} to let shutdown proceed?

{code:title=https://github.com/apache/ozone/blob/6f36abfa83aab57d25cc23682b428968de3faace/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/Gateway.java#L112-L121}
  public void stop() throws Exception {
    LOG.info("Stopping Ozone S3 gateway");
    httpServer.stop();
    contentServer.stop();
    jvmPauseMonitor.stop();
    S3GatewayMetrics.unRegister();
    if (nettyMetrics != null) {
      nettyMetrics.unregister();
    }
 {code}

I suggest:
- let {{BaseHttpServer}} implement {{Closeable}}, calling {{stop()}} from 
{{close()}}
- replace {{httpServer.stop()}} and {{contentServer.stop()}} with 
{{IOUtils.closeQuietly(httpServer, contentServer)}} ({{HttpServer2}} already 
logs exceptions, so this can be quiet)


was (Author: adoroszlai):
[~sarvekshayr], as a workaround, should we catch the exception from 
{{contentServer.stop()}} to let shutdown proceed?

{code:title=https://github.com/apache/ozone/blob/6f36abfa83aab57d25cc23682b428968de3faace/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/Gateway.java#L112-L121}
  public void stop() throws Exception {
    LOG.info("Stopping Ozone S3 gateway");
    httpServer.stop();
    contentServer.stop();
    jvmPauseMonitor.stop();
    S3GatewayMetrics.unRegister();
    if (nettyMetrics != null) {
      nettyMetrics.unregister();
    }
 {code}

> Error stopping S3 Gateway admin webserver
> -----------------------------------------
>
>                 Key: HDDS-13069
>                 URL: https://issues.apache.org/jira/browse/HDDS-13069
>             Project: Apache Ozone
>          Issue Type: Bug
>          Components: s3gateway
>    Affects Versions: 2.0.0
>            Reporter: Attila Doroszlai
>            Assignee: Sarveksha Yeshavantha Raju
>            Priority: Major
>
> {code}
> ozone-s3g-1 | 2025-05-19 08:01:22,234 [shutdown-hook-0] ERROR 
> http.HttpServer2: Error while stopping web app context for webapp s3g-web
> ozone-s3g-1 | java.lang.IllegalStateException: Singleton not set for 
> STATIC_INSTANCE => []
> ozone-s3g-1 |         at 
> org.jboss.weld.bootstrap.api.helpers.RegistrySingletonProvider$RegistrySingleton.get(RegistrySingletonProvider.java:28)
> ...
> ozone-s3g-1 |         at 
> org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:94)
> ozone-s3g-1 |         at 
> org.apache.hadoop.hdds.server.http.HttpServer2.stop(HttpServer2.java:1361)
> ozone-s3g-1 |         at 
> org.apache.hadoop.hdds.server.http.BaseHttpServer.stop(BaseHttpServer.java:344)
> ozone-s3g-1 |         at 
> org.apache.hadoop.ozone.s3.Gateway.stop(Gateway.java:112)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to