lrhkobe opened a new issue, #1047: URL: https://github.com/apache/incubator-eventmesh/issues/1047
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no similar issues. ### Environment Windows ### EventMesh version 1.5.0 ### What happened EventMesh http server send response twice.  ### How to reproduce The code `processor.processRequest(ctx, asyncContext)` contains async logic and it will marked the asyncContext.isComplete() true. ``` processor.processRequest(ctx, asyncContext); if (!asyncContext.isComplete()) { return; } metrics.getSummaryMetrics() .recordHTTPReqResTimeCost(System.currentTimeMillis() - request.getReqTime()); if (httpLogger.isDebugEnabled()) { httpLogger.debug("{}", asyncContext.getResponse()); } //send response first sendResponse(ctx, asyncContext.getResponse().httpResponse()); ``` ``` public void onComplete(final T response, CompleteHandler<T> handler) { Preconditions.checkState(Objects.nonNull(response), "response cant be null"); Preconditions.checkState(Objects.nonNull(handler), "handler cant be null"); this.response = response; // async send response twice **CompletableFuture.runAsync(() -> handler.onResponse(response), asyncContextExecutor); this.complete = Boolean.TRUE;** } ``` ### Debug logs _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! -- 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]
