You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "tanvipenumudy (via GitHub)" <gi...@apache.org> on 2023/09/12 10:20:47 UTC

[GitHub] [ozone] tanvipenumudy commented on a diff in pull request #5274: HDDS-9228. Poor S3G read performance

tanvipenumudy commented on code in PR #5274:
URL: https://github.com/apache/ozone/pull/5274#discussion_r1322815550


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/TracingFilter.java:
##########
@@ -64,36 +60,20 @@ public void filter(ContainerRequestContext requestContext) {
   @Override
   public void filter(ContainerRequestContext requestContext,
       ContainerResponseContext responseContext) {
-    final Scope scope = (Scope) requestContext.getProperty(TRACING_SCOPE);
-    final Span span = (Span) requestContext.getProperty(TRACING_SPAN);
-    // HDDS-7064: Operation performed while writing StreamingOutput response
-    // should only be closed once the StreamingOutput callback has completely
-    // written the data to the destination
-    OutputStream out = responseContext.getEntityStream();
-    if (out != null) {
-      responseContext.setEntityStream(new FilterOutputStream(out) {
-        @Override
-        public void close() throws IOException {
-          super.close();
-          finishAndClose(scope, span);
-        }
-      });
-    } else {
-      finishAndClose(scope, span);
-    }
-  }
-
-  private static void finishAndClose(Scope scope, Span span) {
+    Scope scope = (Scope) requestContext.getProperty(TRACING_SCOPE);
     if (scope != null) {
       scope.close();
     }
+
+    Span span = (Span) requestContext.getProperty(TRACING_SPAN);
     if (span != null) {
       span.finish();
     }
+
     finishAndCloseActiveSpan();
   }
 
-  private static void finishAndCloseActiveSpan() {
+  private void finishAndCloseActiveSpan() {

Review Comment:
   Thanks @ivanzlenko for the review, I made changes.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org