This is an automated email from the ASF dual-hosted git repository.
sureshanaparti pushed a commit to branch 4.18
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.18 by this push:
new 121a35d6666 linstor: do not use the same static ApiClient for all
calls (#9326)
121a35d6666 is described below
commit 121a35d6666dd5e22e0e315db5bfe7cab7191809
Author: Rene Peinthor <[email protected]>
AuthorDate: Wed Jul 3 12:43:16 2024 +0200
linstor: do not use the same static ApiClient for all calls (#9326)
The client.setBasePath() would overwrite the Linstor controller IP/host
for all current client users. This is basically a race condition
that triggered as soon as you had configured 2 different primary storages
with different Linstor controllers.
---
.../java/org/apache/cloudstack/storage/datastore/util/LinstorUtil.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git
a/plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/util/LinstorUtil.java
b/plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/util/LinstorUtil.java
index a23a26bd9dc..9f4dbae7835 100644
---
a/plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/util/LinstorUtil.java
+++
b/plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/util/LinstorUtil.java
@@ -18,7 +18,6 @@ package org.apache.cloudstack.storage.datastore.util;
import com.linbit.linstor.api.ApiClient;
import com.linbit.linstor.api.ApiException;
-import com.linbit.linstor.api.Configuration;
import com.linbit.linstor.api.DevelopersApi;
import com.linbit.linstor.api.model.ApiCallRc;
import com.linbit.linstor.api.model.ApiCallRcList;
@@ -46,7 +45,7 @@ public class LinstorUtil {
public static final String CLUSTER_DEFAULT_MAX_IOPS =
"clusterDefaultMaxIops";
public static DevelopersApi getLinstorAPI(String linstorUrl) {
- ApiClient client = Configuration.getDefaultApiClient();
+ ApiClient client = new ApiClient();
client.setBasePath(linstorUrl);
return new DevelopersApi(client);
}