You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by my...@apache.org on 2023/03/28 06:12:28 UTC
[eventmesh] branch master updated: Added fix for issue apache#3007.
This is an automated email from the ASF dual-hosted git repository.
mytang0 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/eventmesh.git
The following commit(s) were added to refs/heads/master by this push:
new c8100e968 Added fix for issue apache#3007.
new 35926a1c8 Merge pull request #3532 from sanskar-thakur/fix-3007
c8100e968 is described below
commit c8100e968d3febeede426bdefb64ed3542fb4f81
Author: Zaar <sa...@live.com>
AuthorDate: Mon Mar 27 22:56:58 2023 +0530
Added fix for issue apache#3007.
---
.../eventmesh/runtime/admin/handler/GrpcClientHandler.java | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/GrpcClientHandler.java b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/GrpcClientHandler.java
index 2966165c5..b57bed264 100644
--- a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/GrpcClientHandler.java
+++ b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/GrpcClientHandler.java
@@ -76,8 +76,7 @@ public class GrpcClientHandler extends AbstractHttpHandler {
* DELETE /client/grpc
*/
void delete(HttpExchange httpExchange) throws IOException {
- OutputStream out = httpExchange.getResponseBody();
- try {
+ try (OutputStream out = httpExchange.getResponseBody()) {
String request = HttpExchangeUtils.streamToString(httpExchange.getRequestBody());
DeleteGrpcClientRequest deleteGrpcClientRequest = JsonUtils.parseObject(request, DeleteGrpcClientRequest.class);
String url = deleteGrpcClientRequest.getUrl();
@@ -105,14 +104,6 @@ public class GrpcClientHandler extends AbstractHttpHandler {
String result = JsonUtils.toJSONString(error);
httpExchange.sendResponseHeaders(500, result.getBytes().length);
out.write(result.getBytes());
- } finally {
- if (out != null) {
- try {
- out.close();
- } catch (IOException e) {
- log.warn("out close failed...", e);
- }
- }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org