You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "funky-eyes (via GitHub)" <gi...@apache.org> on 2025/05/29 03:09:46 UTC
[PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
funky-eyes opened a new pull request, #7385:
URL: https://github.com/apache/incubator-seata/pull/7385
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Please make sure you have read and understood the contributing guidelines -->
- [ ] I have registered the PR [changes](../changes).
### Ⅰ. Describe what this PR did
The code from #7346 needs to be merged first before reviewing this PR. This PR addresses the first item in the TODO list.
### Ⅱ. Does this pull request fix one issue?
<!-- If that, add "fixes #xxx" below in the next line, for example, fixes #97. -->
### Ⅲ. Why don't you add test cases (unit test/integration test)?
### Ⅳ. Describe how to verify it
### Ⅴ. Special notes for reviews
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#issuecomment-2942941794
> > We don't have a WebApplicationContext because seata-server no longer uses spring-web features. HTTP requests are actually sent to the transaction port 8091, which works in my local testing.
>
> I also ran it locally and it worked fine 🤨 Could it possibly be a port conflict issue?
I think this issue is caused by port conflicts. This port might have been modified by other test cases and is no longer 8091, so I created a separate configuration for this test case, specifying the port as 18091 to avoid conflicts.
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "xjlgod (via GitHub)" <gi...@apache.org>.
xjlgod commented on PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#issuecomment-2919324036
CI Test is not passed, this PR is a bit similar to 7346?
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#discussion_r2127757563
##########
server/src/main/java/org/apache/seata/server/controller/ClusterController.java:
##########
@@ -123,13 +108,16 @@ public MetadataResponse cluster(String group) {
}
@PostMapping("/watch")
- public void watch(HttpServletRequest request, @RequestParam Map<String, Object> groupTerms,
- @RequestParam(defaultValue = "28000") int timeout) {
- AsyncContext context = request.startAsync();
- context.setTimeout(0L);
+ public void watch(HttpContext context, @RequestBody Map<String, Object> groupTerms,
+ @RequestParam(defaultValue = "28000") Integer timeout) {
+ context.setAsync(true);
+ if (timeout == null) {
Review Comment:
> I think this code can be removed.
>
> It would be good to add a test to ensure that defaultValue is correctly applied when null is passed, in case the behavior changes of the Spring Framework version.
>
> If you feel that this test is unnecessary, feel free to leave it out.
>
> 
https://github.com/apache/incubator-seata/issues/7407 We are not using spring-web features; these annotations are only for compatibility with previous spring-web usage patterns. Therefore, what's described in Spring's documentation does not apply to this code.
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on code in PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#discussion_r2127867501
##########
server/src/test/java/org/apache/seata/server/raft/RaftServerTest.java:
##########
@@ -92,4 +93,11 @@ public void initRaftServerFailByRaftPortNull() {
Assertions.assertThrows(IllegalArgumentException.class, RaftServerManager::init);
}
+ @AfterAll
+ public static void afterAll() {
+ LockerManagerFactory.destroy();
+ SessionHolder.destroy();
+ RaftServerManager.destroy();
Review Comment:
There was actually a similar issue recently.
- https://github.com/apache/incubator-seata/pull/7397/files
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on code in PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#discussion_r2126639402
##########
server/src/main/java/org/apache/seata/server/cluster/manager/ClusterWatcherManager.java:
##########
@@ -81,19 +83,38 @@ public void onChangeEvent(ClusterChangeEvent event) {
GROUP_UPDATE_TIME.put(event.getGroup(), event.getTerm());
// Notifications are made of changes in cluster information
Optional.ofNullable(WATCHERS.remove(event.getGroup()))
- .ifPresent(watchers -> watchers.parallelStream().forEach(this::notify));
+ .ifPresent(watchers -> watchers.parallelStream().forEach(this::notifyWatcher));
}
}
- private void notify(Watcher<?> watcher) {
- AsyncContext asyncContext = (AsyncContext)watcher.getAsyncContext();
- HttpServletResponse httpServletResponse = (HttpServletResponse)asyncContext.getResponse();
+ private void notifyWatcher(Watcher<?> watcher) {
watcher.setDone(true);
- if (logger.isDebugEnabled()) {
- logger.debug("notify cluster change event to: {}", asyncContext.getRequest().getRemoteAddr());
+ sendWatcherResponse(watcher, HttpResponseStatus.OK);
+ }
+
+ private void sendWatcherResponse(Watcher<?> watcher, HttpResponseStatus nettyStatus) {
+ Object context = watcher.getAsyncContext();
+ if (context instanceof HttpContext) {
+ HttpContext httpContext = (HttpContext)context;
+ ChannelHandlerContext ctx = httpContext.getContext();
+ if (ctx.channel().isActive()) {
+ HttpResponse response =
+ new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, nettyStatus, Unpooled.EMPTY_BUFFER);
+ response.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0);
+
+ if (!httpContext.isKeepAlive()) {
+ ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
+ } else {
+ ctx.writeAndFlush(response);
+ }
+ } else {
+ logger.warn("Netty channel is not active for watcher on group {}, cannot send response.",
+ watcher.getGroup());
+ }
+ } else {
+ logger.warn("Unsupported context type for watcher on group {}: {}", watcher.getGroup(),
+ context != null ? context.getClass().getName() : "null");
}
Review Comment:
How about adding a return at the end of the if block to reduce the depth?
##########
core/src/main/java/org/apache/seata/core/rpc/netty/http/ParameterParser.java:
##########
@@ -56,51 +58,53 @@ public static ObjectNode convertParamMap(Map<String, List<String>> paramMap) thr
return paramNode;
}
- public static Object[] getArgValues(ParamMetaData[] paramMetaDatas, Method handleMethod, ObjectNode paramMap)
- throws JsonProcessingException {
+ public static Object[] getArgValues(ParamMetaData[] paramMetaDatas, Method handleMethod, ObjectNode paramMap,
+ HttpContext httpContext) throws JsonProcessingException {
Class<?>[] parameterTypes = handleMethod.getParameterTypes();
Parameter[] parameters = handleMethod.getParameters();
- return getParameters(parameterTypes, paramMetaDatas, parameters, paramMap);
+ return getParameters(parameterTypes, paramMetaDatas, parameters, paramMap, httpContext);
}
- private static Object[] getParameters(
- Class<?>[] parameterTypes, ParamMetaData[] paramMetaDatas, Parameter[] parameters, ObjectNode paramMap)
- throws JsonProcessingException {
+ private static Object[] getParameters(Class<?>[] parameterTypes, ParamMetaData[] paramMetaDatas,
+ Parameter[] parameters, ObjectNode paramMap, HttpContext httpContext) throws JsonProcessingException {
int length = parameterTypes.length;
Object[] ret = new Object[length];
for (int i = 0; i < length; i++) {
Class<?> parameterType = parameterTypes[i];
String parameterName = parameters[i].getName();
ParamMetaData paramMetaData = paramMetaDatas[i];
- ret[i] = getArgValue(parameterType, parameterName, paramMetaData, paramMap);
- if (!parameterType.isAssignableFrom(ret[i].getClass())) {
- LOGGER.error(
- "[HttpDispatchHandler] not compatible parameter type, expect {}, but {}",
- parameterType,
- ret[i].getClass());
+ Object value = getArgValue(parameterType, parameterName, paramMetaData, paramMap, httpContext);
+ if (value != null && !parameterType.isAssignableFrom(value.getClass())) {
+ LOGGER.error("[HttpDispatchHandler] not compatible parameter type, expect {}, but {}", parameterType,
+ ret[i].getClass());
ret[i] = null;
+ } else {
+ ret[i] = value;
}
}
return ret;
}
- private static Object getArgValue(
- Class<?> parameterType, String parameterName, ParamMetaData paramMetaData, ObjectNode paramMap)
- throws JsonProcessingException {
+ private static Object getArgValue(Class<?> parameterType, String parameterName, ParamMetaData paramMetaData,
+ ObjectNode paramMap, HttpContext httpContext) throws JsonProcessingException {
ParamMetaData.ParamConvertType paramConvertType = paramMetaData.getParamConvertType();
- if (parameterType.equals(Channel.class)) {
- JsonNode jsonNode = paramMap.get("channel");
- paramMap.putPOJO("channel", null);
- return OBJECT_MAPPER.convertValue(jsonNode, Channel.class);
+ if (parameterType.equals(HttpContext.class)) {
+ return httpContext;
} else if (ParamMetaData.ParamConvertType.MODEL_ATTRIBUTE.equals(paramConvertType)) {
JsonNode param = paramMap.get("param");
return OBJECT_MAPPER.convertValue(param, parameterType);
} else if (ParamMetaData.ParamConvertType.REQUEST_BODY.equals(paramConvertType)) {
JsonNode body = paramMap.get("body");
return OBJECT_MAPPER.convertValue(body, parameterType);
} else {
- return paramMap.get("param").get(parameterName).asText(null);
+ JsonNode jsonNode = paramMap.get("param").get(parameterName);
Review Comment:
If paramMap.get("param") returns null, it will cause a `NullPointerException`.
##########
server/src/main/java/org/apache/seata/server/controller/ClusterController.java:
##########
@@ -123,13 +108,16 @@ public MetadataResponse cluster(String group) {
}
@PostMapping("/watch")
- public void watch(HttpServletRequest request, @RequestParam Map<String, Object> groupTerms,
- @RequestParam(defaultValue = "28000") int timeout) {
- AsyncContext context = request.startAsync();
- context.setTimeout(0L);
+ public void watch(HttpContext context, @RequestBody Map<String, Object> groupTerms,
+ @RequestParam(defaultValue = "28000") Integer timeout) {
+ context.setAsync(true);
+ if (timeout == null) {
Review Comment:
I think this code can be removed.
It would be good to add a test to ensure that defaultValue is correctly applied when null is passed, in case the behavior changes of the Spring Framework version.
If you feel that this test is unnecessary, feel free to leave it out.

--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on code in PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#discussion_r2127866444
##########
server/src/test/java/org/apache/seata/server/raft/RaftServerTest.java:
##########
@@ -92,4 +93,11 @@ public void initRaftServerFailByRaftPortNull() {
Assertions.assertThrows(IllegalArgumentException.class, RaftServerManager::init);
}
+ @AfterAll
+ public static void afterAll() {
+ LockerManagerFactory.destroy();
+ SessionHolder.destroy();
+ RaftServerManager.destroy();
Review Comment:
I agree with you about avoiding side effects in unit tests.
However, what I meant was not to use `@AfterAll`, but rather to use `@AfterEach` in order to improve isolation between test methods within the same class.
Sorry for the confusion — I realize I didn’t explain it clearly earlier! 😅
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on code in PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#discussion_r2127858045
##########
server/src/test/java/org/apache/seata/server/raft/RaftServerTest.java:
##########
@@ -92,4 +93,11 @@ public void initRaftServerFailByRaftPortNull() {
Assertions.assertThrows(IllegalArgumentException.class, RaftServerManager::init);
}
+ @AfterAll
+ public static void afterAll() {
+ LockerManagerFactory.destroy();
+ SessionHolder.destroy();
+ RaftServerManager.destroy();
Review Comment:
Wouldn’t destory the `RaftServerManager` in `@AfterAll` potentially cause test failures if the test execution order 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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#issuecomment-2938242351
> If it’s not urgent to merge right away, would it be okay if I leave a review around this evening?
ok
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#issuecomment-2942906720
> watchTimeoutTest
It looks like the order wasn't set, which caused unit tests that should return 304 to run together with unit tests that should return 200.
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#issuecomment-2942848435
> We don't have a WebApplicationContext because seata-server no longer uses spring-web features. HTTP requests are actually sent to the transaction port 8091, which works in my local testing.
I also ran it locally and it worked fine 🤨
Could it possibly be a port conflict issue?
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#issuecomment-2942641017
> Error: Errors:
Error: ClusterControllerTest.watch:85 » HttpHostConnect Connect to 127.0.0.1:8091 [/1...
Error: ClusterControllerTest.watchTimeoutTest:55 » HttpHostConnect Connect to 127.0.0...
[INFO]
Error: Tests run: 173, Failures: 0, Errors: 2, Skipped: 12
To send actual HTTP requests, you’ll likely need to set the webEnvironment property in `@SpringBootTest`.
> If this doesn’t turn out to be the solution, I’ll look into it again later this afternoon. 😊
- https://docs.spring.io/spring-boot/reference/testing/spring-boot-applications.html

--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#issuecomment-2942827289
> > Error: Errors:
> > Error: ClusterControllerTest.watch:85 » HttpHostConnect Connect to 127.0.0.1:8091 [/1...
> > Error: ClusterControllerTest.watchTimeoutTest:55 » HttpHostConnect Connect to 127.0.0...
> > [INFO]
> > Error: Tests run: 173, Failures: 0, Errors: 2, Skipped: 12
>
> To send actual HTTP requests, you’ll likely need to set the webEnvironment property in `@SpringBootTest`.
>
> > If this doesn’t turn out to be the solution, I’ll look into it again later this afternoon. 😊
>
> * https://docs.spring.io/spring-boot/reference/testing/spring-boot-applications.html
> 
We don't have a WebApplicationContext because seata-server no longer uses spring-web features. HTTP requests are actually sent to the transaction port 8091, which works in my local testing.

--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#discussion_r2128365620
##########
common/src/main/java/org/apache/seata/common/rpc/http/HttpContext.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.seata.common.rpc.http;
+
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.handler.codec.http.HttpRequest;
+
+public class HttpContext {
+
+ HttpRequest request;
+
+ ChannelHandlerContext context;
+
+ boolean keepAlive;
+
+ boolean async = false;
Review Comment:
[nitpick] Fields in `HttpContext` are package-private. For better encapsulation, declare these fields as `private final` and expose them only via getters.
```suggestion
private final HttpRequest request;
private final ChannelHandlerContext context;
private final boolean keepAlive;
private boolean async = false;
```
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#issuecomment-2942890990
@funky-eyes
Error: Failures:
Error: ClusterControllerTest.watchTimeoutTest:61 expected: <304> but was: <200>
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#discussion_r2127863503
##########
server/src/test/java/org/apache/seata/server/raft/RaftServerTest.java:
##########
@@ -92,4 +93,11 @@ public void initRaftServerFailByRaftPortNull() {
Assertions.assertThrows(IllegalArgumentException.class, RaftServerManager::init);
}
+ @AfterAll
+ public static void afterAll() {
+ LockerManagerFactory.destroy();
+ SessionHolder.destroy();
+ RaftServerManager.destroy();
Review Comment:
Not executing the destroy method actually affects other unit tests; each unit test should reset the modifications when it finishes. The exceptions caused by previous changes in test sequence happened because Seata's SPI doesn't support environment isolation. The Dubbo community solved this issue by allowing each unit test to have its own environment where there is a singleton instance, avoiding the mutual interference caused by globally sharing a single instance.
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#issuecomment-2922466972
> CI Test is not passed, this PR is a bit similar to 7346?
It looks like the checkstyle check has failed.
```
Error: /home/runner/work/incubator-seata/incubator-seata/server/src/main/java/org/apache/seata/server/controller/ClusterController.java:117:9: 'if' is not followed by whitespace. [WhitespaceAround]
Error: /home/runner/work/incubator-seata/incubator-seata/server/src/main/java/org/apache/seata/server/controller/ClusterController.java:117:19: '==' is not followed by whitespace. [WhitespaceAround]
Error: /home/runner/work/incubator-seata/incubator-seata/server/src/main/java/org/apache/seata/server/controller/ClusterController.java:117:19: '==' is not preceded with whitespace. [WhitespaceAround]
Error: /home/runner/work/incubator-seata/incubator-seata/server/src/main/java/org/apache/seata/server/controller/ClusterController.java:117:26: '{' is not preceded with whitespace. [WhitespaceAround]
Error: /home/runner/work/incubator-seata/incubator-seata/server/src/main/java/org/apache/seata/server/cluster/manager/ClusterWatcherManager.java:99: 'if' has incorrect indentation level 9, expected level should be 8. [Indentation]
```
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on code in PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#discussion_r2127788930
##########
server/src/main/java/org/apache/seata/server/cluster/manager/ClusterWatcherManager.java:
##########
@@ -81,19 +83,38 @@ public void onChangeEvent(ClusterChangeEvent event) {
GROUP_UPDATE_TIME.put(event.getGroup(), event.getTerm());
// Notifications are made of changes in cluster information
Optional.ofNullable(WATCHERS.remove(event.getGroup()))
- .ifPresent(watchers -> watchers.parallelStream().forEach(this::notify));
+ .ifPresent(watchers -> watchers.parallelStream().forEach(this::notifyWatcher));
}
}
- private void notify(Watcher<?> watcher) {
- AsyncContext asyncContext = (AsyncContext)watcher.getAsyncContext();
- HttpServletResponse httpServletResponse = (HttpServletResponse)asyncContext.getResponse();
+ private void notifyWatcher(Watcher<?> watcher) {
watcher.setDone(true);
- if (logger.isDebugEnabled()) {
- logger.debug("notify cluster change event to: {}", asyncContext.getRequest().getRemoteAddr());
+ sendWatcherResponse(watcher, HttpResponseStatus.OK);
+ }
+
+ private void sendWatcherResponse(Watcher<?> watcher, HttpResponseStatus nettyStatus) {
+ Object context = watcher.getAsyncContext();
+ if (context instanceof HttpContext) {
+ HttpContext httpContext = (HttpContext)context;
+ ChannelHandlerContext ctx = httpContext.getContext();
+ if (ctx.channel().isActive()) {
+ HttpResponse response =
+ new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, nettyStatus, Unpooled.EMPTY_BUFFER);
+ response.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0);
+
+ if (!httpContext.isKeepAlive()) {
+ ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
+ } else {
+ ctx.writeAndFlush(response);
+ }
+ } else {
+ logger.warn("Netty channel is not active for watcher on group {}, cannot send response.",
+ watcher.getGroup());
+ }
+ } else {
+ logger.warn("Unsupported context type for watcher on group {}: {}", watcher.getGroup(),
+ context != null ? context.getClass().getName() : "null");
}
Review Comment:
done
##########
core/src/main/java/org/apache/seata/core/rpc/netty/http/ParameterParser.java:
##########
@@ -56,51 +58,53 @@ public static ObjectNode convertParamMap(Map<String, List<String>> paramMap) thr
return paramNode;
}
- public static Object[] getArgValues(ParamMetaData[] paramMetaDatas, Method handleMethod, ObjectNode paramMap)
- throws JsonProcessingException {
+ public static Object[] getArgValues(ParamMetaData[] paramMetaDatas, Method handleMethod, ObjectNode paramMap,
+ HttpContext httpContext) throws JsonProcessingException {
Class<?>[] parameterTypes = handleMethod.getParameterTypes();
Parameter[] parameters = handleMethod.getParameters();
- return getParameters(parameterTypes, paramMetaDatas, parameters, paramMap);
+ return getParameters(parameterTypes, paramMetaDatas, parameters, paramMap, httpContext);
}
- private static Object[] getParameters(
- Class<?>[] parameterTypes, ParamMetaData[] paramMetaDatas, Parameter[] parameters, ObjectNode paramMap)
- throws JsonProcessingException {
+ private static Object[] getParameters(Class<?>[] parameterTypes, ParamMetaData[] paramMetaDatas,
+ Parameter[] parameters, ObjectNode paramMap, HttpContext httpContext) throws JsonProcessingException {
int length = parameterTypes.length;
Object[] ret = new Object[length];
for (int i = 0; i < length; i++) {
Class<?> parameterType = parameterTypes[i];
String parameterName = parameters[i].getName();
ParamMetaData paramMetaData = paramMetaDatas[i];
- ret[i] = getArgValue(parameterType, parameterName, paramMetaData, paramMap);
- if (!parameterType.isAssignableFrom(ret[i].getClass())) {
- LOGGER.error(
- "[HttpDispatchHandler] not compatible parameter type, expect {}, but {}",
- parameterType,
- ret[i].getClass());
+ Object value = getArgValue(parameterType, parameterName, paramMetaData, paramMap, httpContext);
+ if (value != null && !parameterType.isAssignableFrom(value.getClass())) {
+ LOGGER.error("[HttpDispatchHandler] not compatible parameter type, expect {}, but {}", parameterType,
+ ret[i].getClass());
ret[i] = null;
+ } else {
+ ret[i] = value;
}
}
return ret;
}
- private static Object getArgValue(
- Class<?> parameterType, String parameterName, ParamMetaData paramMetaData, ObjectNode paramMap)
- throws JsonProcessingException {
+ private static Object getArgValue(Class<?> parameterType, String parameterName, ParamMetaData paramMetaData,
+ ObjectNode paramMap, HttpContext httpContext) throws JsonProcessingException {
ParamMetaData.ParamConvertType paramConvertType = paramMetaData.getParamConvertType();
- if (parameterType.equals(Channel.class)) {
- JsonNode jsonNode = paramMap.get("channel");
- paramMap.putPOJO("channel", null);
- return OBJECT_MAPPER.convertValue(jsonNode, Channel.class);
+ if (parameterType.equals(HttpContext.class)) {
+ return httpContext;
} else if (ParamMetaData.ParamConvertType.MODEL_ATTRIBUTE.equals(paramConvertType)) {
JsonNode param = paramMap.get("param");
return OBJECT_MAPPER.convertValue(param, parameterType);
} else if (ParamMetaData.ParamConvertType.REQUEST_BODY.equals(paramConvertType)) {
JsonNode body = paramMap.get("body");
return OBJECT_MAPPER.convertValue(body, parameterType);
} else {
- return paramMap.get("param").get(parameterName).asText(null);
+ JsonNode jsonNode = paramMap.get("param").get(parameterName);
Review Comment:
done
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes merged PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#issuecomment-2938105684
## [Codecov](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: Patch coverage is `32.43243%` with `75 lines` in your changes missing coverage. Please review.
> Project coverage is 58.81%. Comparing base [(`9965051`)](https://app.codecov.io/gh/apache/incubator-seata/commit/9965051476cb96ba6797c05ea44bd40fbc5168f9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`b5f5913`)](https://app.codecov.io/gh/apache/incubator-seata/commit/b5f591326ef06a03f82684110e06d84c55bc0e64?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
| [Files with missing lines](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...seata/core/rpc/netty/http/HttpDispatchHandler.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&filepath=core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fcore%2Frpc%2Fnetty%2Fhttp%2FHttpDispatchHandler.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvY29yZS9ycGMvbmV0dHkvaHR0cC9IdHRwRGlzcGF0Y2hIYW5kbGVyLmphdmE=) | 42.00% | [25 Missing and 4 partials :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [.../server/cluster/manager/ClusterWatcherManager.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&filepath=server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fserver%2Fcluster%2Fmanager%2FClusterWatcherManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zZXJ2ZXIvY2x1c3Rlci9tYW5hZ2VyL0NsdXN0ZXJXYXRjaGVyTWFuYWdlci5qYXZh) | 4.76% | [20 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [.../org/apache/seata/common/rpc/http/HttpContext.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&filepath=common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fcommon%2Frpc%2Fhttp%2FHttpContext.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9jb21tb24vcnBjL2h0dHAvSHR0cENvbnRleHQuamF2YQ==) | 38.88% | [11 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...che/seata/core/rpc/netty/http/ParameterParser.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&filepath=core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fcore%2Frpc%2Fnetty%2Fhttp%2FParameterParser.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvY29yZS9ycGMvbmV0dHkvaHR0cC9QYXJhbWV0ZXJQYXJzZXIuamF2YQ==) | 46.66% | [4 Missing and 4 partials :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...che/seata/server/controller/ClusterController.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&filepath=server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fserver%2Fcontroller%2FClusterController.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zZXJ2ZXIvY29udHJvbGxlci9DbHVzdGVyQ29udHJvbGxlci5qYXZh) | 0.00% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [.../src/main/java/org/apache/seata/server/Server.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&filepath=server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fserver%2FServer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zZXJ2ZXIvU2VydmVyLmphdmE=) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## 2.x #7385 +/- ##
=========================================
Coverage 58.81% 58.81%
- Complexity 531 533 +2
=========================================
Files 1280 1281 +1
Lines 46066 46107 +41
Branches 5557 5562 +5
=========================================
+ Hits 27092 27119 +27
- Misses 16402 16411 +9
- Partials 2572 2577 +5
```
| [Files with missing lines](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [.../src/main/java/org/apache/seata/server/Server.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&filepath=server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fserver%2FServer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zZXJ2ZXIvU2VydmVyLmphdmE=) | `71.87% <0.00%> (ø)` | |
| [...che/seata/server/controller/ClusterController.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&filepath=server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fserver%2Fcontroller%2FClusterController.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zZXJ2ZXIvY29udHJvbGxlci9DbHVzdGVyQ29udHJvbGxlci5qYXZh) | `4.34% <0.00%> (-4.35%)` | :arrow_down: |
| [...che/seata/core/rpc/netty/http/ParameterParser.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&filepath=core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fcore%2Frpc%2Fnetty%2Fhttp%2FParameterParser.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvY29yZS9ycGMvbmV0dHkvaHR0cC9QYXJhbWV0ZXJQYXJzZXIuamF2YQ==) | `70.21% <46.66%> (-0.25%)` | :arrow_down: |
| [.../org/apache/seata/common/rpc/http/HttpContext.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&filepath=common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fcommon%2Frpc%2Fhttp%2FHttpContext.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9jb21tb24vcnBjL2h0dHAvSHR0cENvbnRleHQuamF2YQ==) | `38.88% <38.88%> (ø)` | |
| [.../server/cluster/manager/ClusterWatcherManager.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&filepath=server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fserver%2Fcluster%2Fmanager%2FClusterWatcherManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zZXJ2ZXIvY2x1c3Rlci9tYW5hZ2VyL0NsdXN0ZXJXYXRjaGVyTWFuYWdlci5qYXZh) | `24.48% <4.76%> (-5.52%)` | :arrow_down: |
| [...seata/core/rpc/netty/http/HttpDispatchHandler.java](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&filepath=core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fcore%2Frpc%2Fnetty%2Fhttp%2FHttpDispatchHandler.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvY29yZS9ycGMvbmV0dHkvaHR0cC9IdHRwRGlzcGF0Y2hIYW5kbGVyLmphdmE=) | `45.90% <42.00%> (-6.10%)` | :arrow_down: |
... and [11 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/7385/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
[](https://app.codecov.io/gh/apache/incubator-seata/pull/7385?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#discussion_r2125351290
##########
server/src/main/java/org/apache/seata/server/Server.java:
##########
@@ -96,7 +96,7 @@ public void start(String[] args) {
if (coordinator instanceof ApplicationListener) {
beanFactory.registerSingleton(NettyRemotingServer.class.getName(), nettyRemotingServer);
beanFactory.registerSingleton(DefaultCoordinator.class.getName(), coordinator);
- ((GenericWebApplicationContext) ObjectHolder.INSTANCE.getObject(OBJECT_KEY_SPRING_APPLICATION_CONTEXT))
+ ((AnnotationConfigApplicationContext) ObjectHolder.INSTANCE.getObject(OBJECT_KEY_SPRING_APPLICATION_CONTEXT))
Review Comment:
Casting the application context to AnnotationConfigApplicationContext may cause a ClassCastException if a different context type is used. Consider using a common interface (e.g., ConfigurableApplicationContext) or ensuring the context type matches.
```suggestion
((ConfigurableApplicationContext) ObjectHolder.INSTANCE.getObject(OBJECT_KEY_SPRING_APPLICATION_CONTEXT))
```
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] optimize: remove HttpServletRequest from the watch API [incubator-seata]
Posted by "YongGoose (via GitHub)" <gi...@apache.org>.
YongGoose commented on PR #7385:
URL: https://github.com/apache/incubator-seata/pull/7385#issuecomment-2938129350
If it’s not urgent to merge right away, would it be okay if I leave a review around this evening?
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org