You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2025/04/03 16:28:39 UTC
(airavata) branch cybershuttle-staging updated: fixed the thrift client issue, cannot reuse the client connection for multiple calls
This is an automated email from the ASF dual-hosted git repository.
lahirujayathilake pushed a commit to branch cybershuttle-staging
in repository https://gitbox.apache.org/repos/asf/airavata.git
The following commit(s) were added to refs/heads/cybershuttle-staging by this push:
new 913a62e28b fixed the thrift client issue, cannot reuse the client connection for multiple calls
913a62e28b is described below
commit 913a62e28b88e2ee4a24e887a6506fe703ea73a3
Author: lahiruj <la...@gmail.com>
AuthorDate: Thu Apr 3 12:28:31 2025 -0400
fixed the thrift client issue, cannot reuse the client connection for multiple calls
---
.../apache/airavata/research/service/AiravataService.java | 12 ++++--------
.../research-service/src/main/resources/application.yml | 9 +++++----
2 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/AiravataService.java b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/AiravataService.java
index 3b0586606e..6105e270bb 100644
--- a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/AiravataService.java
+++ b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/AiravataService.java
@@ -18,7 +18,6 @@
*/
package org.apache.airavata.research.service;
-import jakarta.annotation.PostConstruct;
import org.apache.airavata.model.security.AuthzToken;
import org.apache.airavata.model.user.UserProfile;
import org.apache.airavata.research.service.model.UserContext;
@@ -36,19 +35,16 @@ public class AiravataService {
private static final Logger LOGGER = LoggerFactory.getLogger(AiravataService.class);
- private UserProfileService.Client userProfileClient;
-
@Value("${airavata.user-profile.server.url:api.dev.cybershuttle.org}")
private String profileServerUrl;
@Value("${airavata.user-profile.server.port:8962}")
private int profileServerPort;
- @PostConstruct
- public void init() {
+ public UserProfileService.Client userProfileClient() {
try {
- userProfileClient = ProfileServiceClientFactory.createUserProfileServiceClient(profileServerUrl, profileServerPort);
LOGGER.info("User profile client initialized");
+ return ProfileServiceClientFactory.createUserProfileServiceClient(profileServerUrl, profileServerPort);
} catch (UserProfileServiceException e) {
LOGGER.error("Error while creating user profile client", e);
throw new RuntimeException(e);
@@ -57,7 +53,7 @@ public class AiravataService {
public UserProfile getUserProfile(String userId) {
try {
- return userProfileClient.getUserProfileById(UserContext.authzToken(), userId, UserContext.gatewayId());
+ return userProfileClient().getUserProfileById(UserContext.authzToken(), userId, UserContext.gatewayId());
} catch (TException e) {
LOGGER.error("Error while getting user profile with the id: {}", userId, e);
throw new RuntimeException("Error while getting user profile with the id: " + userId, e);
@@ -67,7 +63,7 @@ public class AiravataService {
public UserProfile getUserProfile(AuthzToken authzToken, String userId, String gatewayId) {
try {
- return userProfileClient.getUserProfileById(authzToken, userId, gatewayId);
+ return userProfileClient().getUserProfileById(authzToken, userId, gatewayId);
} catch (TException e) {
LOGGER.error("Error while getting user profile with the id: {} in the gateway: {}", userId, gatewayId, e);
throw new RuntimeException("Error while getting user profile with the id: " + userId + " in the gateway: " + gatewayId, e);
diff --git a/modules/research-framework/research-service/src/main/resources/application.yml b/modules/research-framework/research-service/src/main/resources/application.yml
index a44359b23a..9b2b574596 100644
--- a/modules/research-framework/research-service/src/main/resources/application.yml
+++ b/modules/research-framework/research-service/src/main/resources/application.yml
@@ -9,10 +9,11 @@ server:
airavata:
research-hub:
url: https://hub.dev.cybershuttle.org
- dev-user: "ganning.xu@gatech.edu"
+ dev-user: "ljayathilake3@gatech.edu"
user-profile:
- server: api.dev.cybershuttle.org
- port: 8962
+ server:
+ url: api.dev.cybershuttle.org
+ port: 8962
spring:
servlet:
@@ -29,7 +30,7 @@ spring:
leak-detection-threshold: 20000
jpa:
hibernate:
- ddl-auto: create-drop
+ ddl-auto: update
open-in-view: false
springdoc: