You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "zhangshenghang (via GitHub)" <gi...@apache.org> on 2025/01/13 12:27:02 UTC

[PR] ' [seatunnel-web]

zhangshenghang opened a new pull request, #267:
URL: https://github.com/apache/seatunnel-web/pull/267

   <!--
   
   Thank you for contributing to SeaTunnel! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/seatunnel/issues).
   
     - Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
   
     - Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
   
   -->
   
   ## Purpose of this pull request
   
   <!-- Describe the purpose of this pull request. For example: This pull request adds checkstyle plugin.-->
   
   ## Check list
   
   * [ ] Code changed are covered with tests, or it does not need tests for reason:
   * [ ] If any new Jar binary package adding in your PR, please add License Notice according
     [New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/contribution/new-license.md)
   * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


Re: [PR] [Improve]Optimize the way of obtaining user information. [seatunnel-web]

Posted by "arshadmohammad (via GitHub)" <gi...@apache.org>.
arshadmohammad commented on code in PR #267:
URL: https://github.com/apache/seatunnel-web/pull/267#discussion_r1933681198


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/config/AsyncConfig.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.seatunnel.app.config;
+
+import org.apache.seatunnel.app.dal.entity.User;
+import org.apache.seatunnel.app.security.UserContext;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.task.TaskDecorator;
+import org.springframework.scheduling.annotation.AsyncConfigurer;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.Executor;
+
+@Configuration
+@EnableAsync
+public class AsyncConfig implements AsyncConfigurer {
+
+    @Bean
+    public ThreadPoolTaskExecutor taskExecutor() {
+        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+        executor.setCorePoolSize(10);
+        executor.setMaxPoolSize(20);
+        executor.setQueueCapacity(100);

Review Comment:
   @zhangshenghang can you please handle this



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


Re: [PR] [Improve]Optimize the way of obtaining user information. [seatunnel-web]

Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on code in PR #267:
URL: https://github.com/apache/seatunnel-web/pull/267#discussion_r1919431277


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/config/AsyncConfig.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.seatunnel.app.config;
+
+import org.apache.seatunnel.app.dal.entity.User;
+import org.apache.seatunnel.app.security.UserContext;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.task.TaskDecorator;
+import org.springframework.scheduling.annotation.AsyncConfigurer;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.Executor;
+
+@Configuration
+@EnableAsync
+public class AsyncConfig implements AsyncConfigurer {
+
+    @Bean
+    public ThreadPoolTaskExecutor taskExecutor() {
+        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+        executor.setCorePoolSize(10);
+        executor.setMaxPoolSize(20);
+        executor.setQueueCapacity(100);

Review Comment:
   > can you make these parameters configurable.
   
   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: commits-unsubscribe@seatunnel.apache.org

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


Re: [PR] [Improve]Optimize the way of obtaining user information. [seatunnel-web]

Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on PR #267:
URL: https://github.com/apache/seatunnel-web/pull/267#issuecomment-2587056332

   @Hisoka-X  PTAL 


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


Re: [PR] [Improve]Optimize the way of obtaining user information. [seatunnel-web]

Posted by "arshadmohammad (via GitHub)" <gi...@apache.org>.
arshadmohammad commented on code in PR #267:
URL: https://github.com/apache/seatunnel-web/pull/267#discussion_r1919857240


##########
seatunnel-server/seatunnel-app/src/main/resources/application.yml:
##########
@@ -31,6 +31,10 @@ spring:
   mvc:
     pathmatch:
       matching-strategy: ant_path_matcher
+  async-config:
+    core-pool-size: 10
+    max-pool-size: 20
+    queue-capacity: 100
 

Review Comment:
   Seems this configuration is not used in the 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: commits-unsubscribe@seatunnel.apache.org

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


Re: [PR] [Improve]Optimize the way of obtaining user information. [seatunnel-web]

Posted by "arshadmohammad (via GitHub)" <gi...@apache.org>.
arshadmohammad commented on code in PR #267:
URL: https://github.com/apache/seatunnel-web/pull/267#discussion_r1919862178


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/config/AsyncConfig.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.seatunnel.app.config;
+
+import org.apache.seatunnel.app.dal.entity.User;
+import org.apache.seatunnel.app.security.UserContext;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.task.TaskDecorator;
+import org.springframework.scheduling.annotation.AsyncConfigurer;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.Executor;
+
+@Configuration
+@EnableAsync
+public class AsyncConfig implements AsyncConfigurer {
+
+    @Bean
+    public ThreadPoolTaskExecutor taskExecutor() {
+        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+        executor.setCorePoolSize(10);
+        executor.setMaxPoolSize(20);
+        executor.setQueueCapacity(100);

Review Comment:
   I noticed that you have added async-config, but it is not being used in this code. Could you please verify this? Additionally, ensure that if the async-config entry is missing from the configuration, the default values are used.



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


Re: [PR] [Improve]Optimize the way of obtaining user information. [seatunnel-web]

Posted by "arshadmohammad (via GitHub)" <gi...@apache.org>.
arshadmohammad commented on PR #267:
URL: https://github.com/apache/seatunnel-web/pull/267#issuecomment-2596222531

   Nice improvement, Thanks @zhangshenghang 


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


Re: [PR] [Improve]Optimize the way of obtaining user information. [seatunnel-web]

Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on PR #267:
URL: https://github.com/apache/seatunnel-web/pull/267#issuecomment-2628944707

   > `executor.setCorePoolSize(10); executor.setMaxPoolSize(20); executor.setQueueCapacity(100);` The AsyncConfig class is currently using hard-coded values instead of utilizing the configuration settings. @zhangshenghang can you handle this?
   
   OK. I forgot to submit it. It has been revised.


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


Re: [PR] [Improve]Optimize the way of obtaining user information. [seatunnel-web]

Posted by "arshadmohammad (via GitHub)" <gi...@apache.org>.
arshadmohammad merged PR #267:
URL: https://github.com/apache/seatunnel-web/pull/267


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


Re: [PR] [Improve]Optimize the way of obtaining user information. [seatunnel-web]

Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on PR #267:
URL: https://github.com/apache/seatunnel-web/pull/267#issuecomment-2625949821

   @arshadmohammad @Hisoka-X PTAL


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


Re: [PR] [Improve]Optimize the way of obtaining user information. [seatunnel-web]

Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on PR #267:
URL: https://github.com/apache/seatunnel-web/pull/267#issuecomment-2597234532

   > @zhangshenghang this makes a lot of sense, but isn't it possible to leverage `spring-boot-starter-security` and use SecurityContextHolder?
   
   @shashwatsai  Yes, currently the project does not use `spring-boot-starter-security`, it can be optimized separately.


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


Re: [PR] [Improve]Optimize the way of obtaining user information. [seatunnel-web]

Posted by "arshadmohammad (via GitHub)" <gi...@apache.org>.
arshadmohammad commented on code in PR #267:
URL: https://github.com/apache/seatunnel-web/pull/267#discussion_r1918882435


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/config/AsyncConfig.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.seatunnel.app.config;
+
+import org.apache.seatunnel.app.dal.entity.User;
+import org.apache.seatunnel.app.security.UserContext;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.task.TaskDecorator;
+import org.springframework.scheduling.annotation.AsyncConfigurer;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.Executor;
+
+@Configuration
+@EnableAsync
+public class AsyncConfig implements AsyncConfigurer {
+
+    @Bean
+    public ThreadPoolTaskExecutor taskExecutor() {
+        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+        executor.setCorePoolSize(10);
+        executor.setMaxPoolSize(20);
+        executor.setQueueCapacity(100);

Review Comment:
   can you make these parameters configurable.



-- 
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: commits-unsubscribe@seatunnel.apache.org

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


Re: [PR] [Improve]Optimize the way of obtaining user information. [seatunnel-web]

Posted by "shashwatsai (via GitHub)" <gi...@apache.org>.
shashwatsai commented on PR #267:
URL: https://github.com/apache/seatunnel-web/pull/267#issuecomment-2595961634

   @zhangshenghang this makes a lot of sense, but isn't it possible to leverage `spring-boot-starter-security` and use SecurityContextHolder? 
   
   If we plan 
   
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


Re: [PR] [Improve]Optimize the way of obtaining user information. [seatunnel-web]

Posted by "zhangshenghang (via GitHub)" <gi...@apache.org>.
zhangshenghang commented on PR #267:
URL: https://github.com/apache/seatunnel-web/pull/267#issuecomment-2628951337

   @arshadmohammad @Hisoka-X PTAL


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


Re: [PR] [Improve]Optimize the way of obtaining user information. [seatunnel-web]

Posted by "arshadmohammad (via GitHub)" <gi...@apache.org>.
arshadmohammad commented on PR #267:
URL: https://github.com/apache/seatunnel-web/pull/267#issuecomment-2626394389

   `executor.setCorePoolSize(10);
           executor.setMaxPoolSize(20);
           executor.setQueueCapacity(100);`
   The AsyncConfig class is currently using hard-coded values instead of utilizing the configuration settings. @zhangshenghang  can you handle this?
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


Re: [PR] [Improve]Optimize the way of obtaining user information. [seatunnel-web]

Posted by "arshadmohammad (via GitHub)" <gi...@apache.org>.
arshadmohammad commented on PR #267:
URL: https://github.com/apache/seatunnel-web/pull/267#issuecomment-2635726643

   Many integration tests are failing
   [ERROR]   UserControllerTest.login_shouldFail_whenInvalidAuthType:139 » Runtime
   [ERROR]   UserControllerTest.login_shouldPass_whenNoAuthType:124 » Runtime
   [ERROR]   UserControllerTest.login_shouldPass_whenValidAuthType:109 » Runtime
   [ERROR]   UserControllerTest.tearDown:184 » Runtime
   [ERROR]   UserControllerTest.updateUser_shouldReturnSuccess_whenValidRequest:73 » Runtime
   [INFO] 
   [ERROR] Tests run: 48, Failures: 0, Errors: 48, Skipped: 0
   [INFO] 
   [ERROR] There are test failures.
   
   @zhangshenghang  can you please run the integration tests and handle the failure.


-- 
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: commits-unsubscribe@seatunnel.apache.org

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


Re: [PR] [Improve]Optimize the way of obtaining user information. [seatunnel-web]

Posted by "arshadmohammad (via GitHub)" <gi...@apache.org>.
arshadmohammad commented on PR #267:
URL: https://github.com/apache/seatunnel-web/pull/267#issuecomment-2635763740

   Apologies for the confusion. After upgrading my existing Seatunnel database by executing the script below, the test cases have now passed.
   
   ALTER TABLE `user` ADD COLUMN `auth_provider` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'DB';
   
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

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