From 2896022025cba0bfaeb6e842f709292a8fe1c324 Mon Sep 17 00:00:00 2001 From: xiaoxiawang Date: Tue, 2 Dec 2025 16:52:07 +0800 Subject: [PATCH 1/5] =?UTF-8?q?reason:=E8=AE=BE=E7=BD=AEworkdir=E4=B8=8D?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit reason:设置workdir不为空 reason:设置workdir不为空 reason:设置workdir不为空 reason:设置workdir不为空 reason:设置workdir不为空 reason:设置workdir不为空 --- api/python/yr/config_manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/python/yr/config_manager.py b/api/python/yr/config_manager.py index 186c5176..a24d19ba 100644 --- a/api/python/yr/config_manager.py +++ b/api/python/yr/config_manager.py @@ -17,6 +17,7 @@ """config manager""" import logging +import os from yr.common import utils from yr.common.singleton import Singleton @@ -289,7 +290,7 @@ class ConfigManager: self.http_ioc_threads_num = conf.http_ioc_threads_num self.server_name = conf.server_name self.ns = conf.ns - self.working_dir = conf.working_dir + self.working_dir = conf.working_dir if conf.working_dir else os.getcwd() self.enable_ds_encrypt = conf.enable_ds_encrypt self.ds_public_key_path = conf.ds_public_key_path self.runtime_public_key_path = conf.runtime_public_key_path -- Gitee From 6791e0624e616e99d4d53f1b910f64bfedc18958 Mon Sep 17 00:00:00 2001 From: xiaoxiawang Date: Tue, 2 Dec 2025 19:36:13 +0800 Subject: [PATCH 2/5] =?UTF-8?q?reason:=E5=88=A0=E9=99=A4ReleaseGRefs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/go/faassdk/handler/event/handler_test.go | 9 --------- .../handler/http/custom_container_handler_test.go | 5 ----- api/go/faassdk/handler/http/state_test.go | 4 ---- api/go/faassdk/handler/mock_utils_test.go | 5 ----- api/go/libruntime/api/api.go | 1 - api/go/libruntime/clibruntime/clibruntime.go | 13 ------------- api/go/libruntime/clibruntime/clibruntime_test.go | 9 --------- api/go/libruntime/cpplibruntime/clibruntime.h | 1 - api/go/libruntime/cpplibruntime/cpplibruntime.cpp | 10 ---------- .../cpplibruntime/mock/mock_cpplibruntime.cpp | 5 ----- .../libruntimesdkimpl/libruntimesdkimpl.go | 6 ------ .../libruntimesdkimpl/libruntimesdkimpl_test.go | 6 ------ api/go/yr/cluster_mode_runtime.go | 5 ----- api/go/yr/cluster_mode_runtime_test.go | 13 ------------- .../common/faas_common/utils/libruntimeapi_mock.go | 5 ----- .../faas_common/utils/libruntimeapi_mock_test.go | 3 --- go/pkg/functionmanager/faasmanager.go | 13 ------------- src/libruntime/gwclient/gw_client.cpp | 5 ----- src/libruntime/gwclient/gw_client.h | 1 - src/libruntime/libruntime.cpp | 6 ------ src/libruntime/libruntime.h | 7 ------- .../objectstore/datasystem_object_store.cpp | 10 ---------- .../objectstore/datasystem_object_store.h | 2 -- src/libruntime/objectstore/memory_store.cpp | 5 ----- src/libruntime/objectstore/memory_store.h | 1 - src/libruntime/objectstore/object_store.h | 1 - test/libruntime/gw_client_test.cpp | 3 --- test/libruntime/libruntime_test.cpp | 5 ----- test/libruntime/mock/mock_datasystem.h | 1 - test/libruntime/mock/mock_datasystem_client.cpp | 5 ----- test/libruntime/object_store_test.cpp | 6 ------ 31 files changed, 171 deletions(-) diff --git a/api/go/faassdk/handler/event/handler_test.go b/api/go/faassdk/handler/event/handler_test.go index e1f6a300..1bd13eda 100644 --- a/api/go/faassdk/handler/event/handler_test.go +++ b/api/go/faassdk/handler/event/handler_test.go @@ -253,15 +253,6 @@ func (m mockLibruntimeClient) GetFormatLogger() api.FormatLogger { panic("implement me") } -func (m mockLibruntimeClient) CreateClient(config api.ConnectArguments) (api.KvClient, error) { - //TODO implement me - panic("implement me") -} - -func (m mockLibruntimeClient) ReleaseGRefs(remoteClientID string) error { - //TODO implement me - panic("implement me") -} func (m mockLibruntimeClient) GetCredential() api.Credential { return api.Credential{} } diff --git a/api/go/faassdk/handler/http/custom_container_handler_test.go b/api/go/faassdk/handler/http/custom_container_handler_test.go index 1cc8b343..fde5f7e1 100644 --- a/api/go/faassdk/handler/http/custom_container_handler_test.go +++ b/api/go/faassdk/handler/http/custom_container_handler_test.go @@ -231,11 +231,6 @@ func (f *fakeSDKClient) CreateClient(config api.ConnectArguments) (api.KvClient, return &FakeDataSystemClinet{}, nil } -func (f *fakeSDKClient) ReleaseGRefs(remoteClientID string) error { - //TODO implement me - panic("implement me") -} - func (f *fakeSDKClient) SaveState(state []byte) (string, error) { return "", nil } diff --git a/api/go/faassdk/handler/http/state_test.go b/api/go/faassdk/handler/http/state_test.go index e1eac171..21452246 100644 --- a/api/go/faassdk/handler/http/state_test.go +++ b/api/go/faassdk/handler/http/state_test.go @@ -93,10 +93,6 @@ func (f *FakeDataSystemClinet) GDecreaseRef(objectIds []string, remoteClientId . return []string{}, nil } -func (f *FakeDataSystemClinet) ReleaseGRefs(remoteClientId string) error { - return nil -} - func TestGetStateManager(t *testing.T) { dsClient := &FakeDataSystemClinet{} diff --git a/api/go/faassdk/handler/mock_utils_test.go b/api/go/faassdk/handler/mock_utils_test.go index fa30effd..2ea5ce5b 100644 --- a/api/go/faassdk/handler/mock_utils_test.go +++ b/api/go/faassdk/handler/mock_utils_test.go @@ -228,11 +228,6 @@ func (m mockLibruntimeClient) CreateClient(config api.ConnectArguments) (api.KvC panic("implement me") } -func (m mockLibruntimeClient) ReleaseGRefs(remoteClientID string) error { - //TODO implement me - panic("implement me") -} - func (m *mockLibruntimeClient) UpdateSchdulerInfo(schedulerName string, option string) { //TODO implement me panic("implement me") diff --git a/api/go/libruntime/api/api.go b/api/go/libruntime/api/api.go index 2a002559..bd5d8325 100644 --- a/api/go/libruntime/api/api.go +++ b/api/go/libruntime/api/api.go @@ -69,7 +69,6 @@ type LibruntimeAPI interface { GetFormatLogger() FormatLogger CreateClient(config ConnectArguments) (KvClient, error) - ReleaseGRefs(remoteClientID string) error GetCredential() Credential UpdateSchdulerInfo(schedulerName string, schedulerId string, option string) IsHealth() bool diff --git a/api/go/libruntime/clibruntime/clibruntime.go b/api/go/libruntime/clibruntime/clibruntime.go index c556a8a6..56e445b6 100644 --- a/api/go/libruntime/clibruntime/clibruntime.go +++ b/api/go/libruntime/clibruntime/clibruntime.go @@ -1538,19 +1538,6 @@ func GDecreaseRefRaw(objectIDs []string, remoteClientID ...string) ([]string, er return GDecreaseRefCommon(objectIDs, true, remoteClientID...) } -// ReleaseGRefs release object refs by remote client id -func ReleaseGRefs(remoteClientID string) error { - var cRemoteID *C.char = nil - cRemoteID = C.CString(remoteClientID) - defer C.free(unsafe.Pointer(cRemoteID)) - cErr := C.CReleaseGRefs(cRemoteID) - code := int(cErr.code) - if code != 0 { - return codeNotZeroErr(code, cErr, "global decrease ref: ") - } - return nil -} - // AllocReturnObject Creates an object and applies for a memory block. // Computing operations can be performed on the memory block. // will return a 'Buffer' that will be used to manipulate the memory diff --git a/api/go/libruntime/clibruntime/clibruntime_test.go b/api/go/libruntime/clibruntime/clibruntime_test.go index a12a375d..cd85df29 100644 --- a/api/go/libruntime/clibruntime/clibruntime_test.go +++ b/api/go/libruntime/clibruntime/clibruntime_test.go @@ -831,15 +831,6 @@ func TestGDecreaseRefRaw(t *testing.T) { ) } -func TestReleaseGRefs(t *testing.T) { - convey.Convey( - "Test ReleaseGRefs", t, func() { - err := ReleaseGRefs("remoteClientID") - convey.So(err, convey.ShouldBeNil) - }, - ) -} - func TestAllocReturnObject(t *testing.T) { convey.Convey( "Test AllocReturnObject", t, func() { diff --git a/api/go/libruntime/cpplibruntime/clibruntime.h b/api/go/libruntime/cpplibruntime/clibruntime.h index 9546c909..d764ff2a 100644 --- a/api/go/libruntime/cpplibruntime/clibruntime.h +++ b/api/go/libruntime/cpplibruntime/clibruntime.h @@ -406,7 +406,6 @@ CErrorInfo CIncreaseReferenceCommon(char **cObjIds, int size_cObjIds, char *cRem int *size_cFailedIds, char isRaw); CErrorInfo CDecreaseReferenceCommon(char **cObjIds, int size_cObjIds, char *cRemoteId, char ***cFailedIds, int *size_cFailedIds, char isRaw); -CErrorInfo CReleaseGRefs(char *cRemoteId); CErrorInfo CAllocReturnObject(CDataObject *object, int dataSize, char **nestedIds, int sizeNestedIds, uint64_t *totalNativeBufferSize); void CSetReturnObject(CDataObject *cObject, int dataSize); diff --git a/api/go/libruntime/cpplibruntime/cpplibruntime.cpp b/api/go/libruntime/cpplibruntime/cpplibruntime.cpp index e52191b3..9fc9da9a 100644 --- a/api/go/libruntime/cpplibruntime/cpplibruntime.cpp +++ b/api/go/libruntime/cpplibruntime/cpplibruntime.cpp @@ -1136,16 +1136,6 @@ CErrorInfo CDecreaseReferenceCommon(char **cObjIds, int size_cObjIds, char *cRem return ErrorInfoToCError(err1); } -CErrorInfo CReleaseGRefs(char *cRemoteId) -{ - auto [lrt, err] = getLibRuntime(); - if (!err.OK()) { - return ErrorInfoToCError(err); - } - err = lrt->ReleaseGRefs(cRemoteId); - return ErrorInfoToCError(err); -} - CErrorInfo CKVWrite(char *key, CBuffer data, CSetParam param) { auto mData = std::make_shared(data.size_buffer); diff --git a/api/go/libruntime/cpplibruntime/mock/mock_cpplibruntime.cpp b/api/go/libruntime/cpplibruntime/mock/mock_cpplibruntime.cpp index e0f25770..1d92a965 100644 --- a/api/go/libruntime/cpplibruntime/mock/mock_cpplibruntime.cpp +++ b/api/go/libruntime/cpplibruntime/mock/mock_cpplibruntime.cpp @@ -223,11 +223,6 @@ CErrorInfo CDecreaseReferenceCommon(char **cObjIds, int size_cObjIds, char *cRem return ErrorInfoToCError(ErrorInfo()); } -CErrorInfo CReleaseGRefs(char *cRemoteId) -{ - return ErrorInfoToCError(ErrorInfo()); -} - CErrorInfo CKVWrite(char *key, CBuffer data, CSetParam param) { return ErrorInfoToCError(ErrorInfo()); diff --git a/api/go/libruntime/libruntimesdkimpl/libruntimesdkimpl.go b/api/go/libruntime/libruntimesdkimpl/libruntimesdkimpl.go index 41c9569d..6a38b540 100644 --- a/api/go/libruntime/libruntimesdkimpl/libruntimesdkimpl.go +++ b/api/go/libruntime/libruntimesdkimpl/libruntimesdkimpl.go @@ -192,12 +192,6 @@ func (l *libruntimeSDKImpl) GDecreaseRefRaw(objectIDs []string, remoteClientID . return clibruntime.GDecreaseRefRaw(objectIDs, remoteClientID...) } -// ReleaseGRefs release object refs by remote client id -func (l *libruntimeSDKImpl) ReleaseGRefs(remoteClientID string) error { - err := clibruntime.ReleaseGRefs(remoteClientID) - return err -} - func (l *libruntimeSDKImpl) GetAsync(objectID string, cb api.GetAsyncCallback) { clibruntime.GetAsync(objectID, cb) } diff --git a/api/go/libruntime/libruntimesdkimpl/libruntimesdkimpl_test.go b/api/go/libruntime/libruntimesdkimpl/libruntimesdkimpl_test.go index 8ea86048..37a4a09f 100644 --- a/api/go/libruntime/libruntimesdkimpl/libruntimesdkimpl_test.go +++ b/api/go/libruntime/libruntimesdkimpl/libruntimesdkimpl_test.go @@ -292,12 +292,6 @@ func TestLibruntimeSDKImpl(t *testing.T) { convey.So(err, convey.ShouldBeNil) }, ) - convey.Convey( - "ReleaseGRefs success", func() { - err := libruntimeAPI.ReleaseGRefs("objectID") - convey.So(err, convey.ShouldBeNil) - }, - ) convey.Convey( "GetAsync success", func() { convey.So(func() { diff --git a/api/go/yr/cluster_mode_runtime.go b/api/go/yr/cluster_mode_runtime.go index d65c6652..201f9144 100644 --- a/api/go/yr/cluster_mode_runtime.go +++ b/api/go/yr/cluster_mode_runtime.go @@ -232,11 +232,6 @@ func (r *ClusterModeRuntime) CreateClient(config api.ConnectArguments) (api.KvCl return nil, nil } -// ReleaseGRefs release object refs by remote client id -func (r *ClusterModeRuntime) ReleaseGRefs(remoteClientID string) error { - return fmt.Errorf("not support") -} - // GetCredential - func (r *ClusterModeRuntime) GetCredential() api.Credential { return api.Credential{} diff --git a/api/go/yr/cluster_mode_runtime_test.go b/api/go/yr/cluster_mode_runtime_test.go index 3f04e847..4e41ec9d 100644 --- a/api/go/yr/cluster_mode_runtime_test.go +++ b/api/go/yr/cluster_mode_runtime_test.go @@ -288,16 +288,3 @@ func TestCreateClient(t *testing.T) { }, ) } - -func TestReleaseGRefs(t *testing.T) { - convey.Convey( - "Test ReleaseGRefs", t, func() { - convey.Convey( - "ReleaseGRefs success", func() { - err := clusterRt.ReleaseGRefs("") - convey.So(err, convey.ShouldNotBeNil) - }, - ) - }, - ) -} diff --git a/go/pkg/common/faas_common/utils/libruntimeapi_mock.go b/go/pkg/common/faas_common/utils/libruntimeapi_mock.go index 00e73c7c..64349725 100644 --- a/go/pkg/common/faas_common/utils/libruntimeapi_mock.go +++ b/go/pkg/common/faas_common/utils/libruntimeapi_mock.go @@ -233,11 +233,6 @@ func (f *FakeLibruntimeSdkClient) CreateClient(config api.ConnectArguments) (api return nil, nil } -// ReleaseGRefs - -func (f *FakeLibruntimeSdkClient) ReleaseGRefs(remoteClientID string) error { - return nil -} - // GetCredential - func (f *FakeLibruntimeSdkClient) GetCredential() api.Credential { return api.Credential{} diff --git a/go/pkg/common/faas_common/utils/libruntimeapi_mock_test.go b/go/pkg/common/faas_common/utils/libruntimeapi_mock_test.go index 3f077761..a91d37d0 100644 --- a/go/pkg/common/faas_common/utils/libruntimeapi_mock_test.go +++ b/go/pkg/common/faas_common/utils/libruntimeapi_mock_test.go @@ -105,9 +105,6 @@ func TestFakeLibruntimeSdkClient(t *testing.T) { _, err = fakeLibruntimeSdkClient.CreateClient(api.ConnectArguments{}) assert.Equal(t, nil, err) - err = fakeLibruntimeSdkClient.ReleaseGRefs("") - assert.Equal(t, nil, err) - credential := fakeLibruntimeSdkClient.GetCredential() assert.NotEqual(t, nil, credential) } diff --git a/go/pkg/functionmanager/faasmanager.go b/go/pkg/functionmanager/faasmanager.go index 7bd63af5..4c3c2431 100644 --- a/go/pkg/functionmanager/faasmanager.go +++ b/go/pkg/functionmanager/faasmanager.go @@ -504,19 +504,6 @@ func (m *Manager) saveStateLoop() { } } -func killInstanceOuter(clientID string, traceID string) { - log.GetLogger().Infof("start to kill instance outer, clientID: %s, traceID:%s", clientID, traceID) - if err := libruntimeClient.Kill(clientID, types.KillSignalVal, []byte{}); err != nil { - log.GetLogger().Warnf("failed to clean instances when delete lease, traceID: %s, "+ - "remoteClientID:%s, status:%s", traceID, clientID, err.Error()) - } - libruntimeClient.SetTraceID(traceID) - if err := libruntimeClient.ReleaseGRefs(clientID); err != nil { - log.GetLogger().Warnf("failed to release refs when delete lease, traceID: %s, "+ - "remoteClientID:%s, status:%s", traceID, clientID, err.Error()) - } -} - func (m *Manager) handleKeepAlive(requestData []byte, traceID string) *commonType.CallHandlerResponse { remoteClientID := string(requestData) log.GetLogger().Infof("receive keep-alive lease from faas-frontend, traceID: %s", traceID) diff --git a/src/libruntime/gwclient/gw_client.cpp b/src/libruntime/gwclient/gw_client.cpp index 9fef7702..bcde9467 100644 --- a/src/libruntime/gwclient/gw_client.cpp +++ b/src/libruntime/gwclient/gw_client.cpp @@ -859,11 +859,6 @@ ErrorInfo GwClient::ParseDecreaseRefResponse(const std::string &result, ModuleCode::DATASYSTEM, decreaseRefRsp.message()); } -ErrorInfo GwClient::ReleaseGRefs(const std::string &remoteId) -{ - return ErrorInfo(ErrorCode::ERR_PARAM_INVALID, ModuleCode::RUNTIME, "not support out of cluster"); -} - LeaseRequest GwClient::BuildLeaseRequest() { LeaseRequest leaseReq; diff --git a/src/libruntime/gwclient/gw_client.h b/src/libruntime/gwclient/gw_client.h index 944ffd42..dbc84477 100644 --- a/src/libruntime/gwclient/gw_client.h +++ b/src/libruntime/gwclient/gw_client.h @@ -148,7 +148,6 @@ public: STDERR_AND_THROW_EXCEPTION(ERR_INNER_SYSTEM_ERROR, RUNTIME, "QueryGlobalReference method is not supported when inCluster is false"); } - ErrorInfo ReleaseGRefs(const std::string &remoteId) override; ErrorInfo GenerateKey(std::string &key, const std::string &prefix, bool isPut) override; ErrorInfo GetPrefix(const std::string &key, std::string &prefix) override; ErrorInfo Write(const std::string &key, std::shared_ptr value, SetParam setParam) override; diff --git a/src/libruntime/libruntime.cpp b/src/libruntime/libruntime.cpp index 227bef04..4c76edc7 100755 --- a/src/libruntime/libruntime.cpp +++ b/src/libruntime/libruntime.cpp @@ -810,12 +810,6 @@ std::pair> Libruntime::DecreaseReferenceRaw( return dsClients.dsObjectStore->DecreGlobalReference(objIds, remoteId); } -ErrorInfo Libruntime::ReleaseGRefs(const std::string &remoteId) -{ - SetTraceId(); - return memStore->ReleaseGRefs(remoteId); -} - // timeout < 0 : wait without timeout std::shared_ptr Libruntime::Wait(const std::vector &objs, std::size_t waitNum, int timeoutSec) diff --git a/src/libruntime/libruntime.h b/src/libruntime/libruntime.h index b5898344..6a83141d 100644 --- a/src/libruntime/libruntime.h +++ b/src/libruntime/libruntime.h @@ -280,13 +280,6 @@ public: virtual std::pair> DecreaseReferenceRaw(const std::vector &objIds, const std::string &remoteId); - /*! - @brief Releases global references associated with a remote ID - @param remoteId The ID of the remote context - @return An `ErrorInfo` object indicating the success or failure of the operation - */ - virtual ErrorInfo ReleaseGRefs(const std::string &remoteId); - /*! @brief Allocates and initializes a return object with specified metadata and data sizes This function allocates a `DataObject` and initializes it with the provided metadata size, data size, diff --git a/src/libruntime/objectstore/datasystem_object_store.cpp b/src/libruntime/objectstore/datasystem_object_store.cpp index 61356286..8686aed6 100644 --- a/src/libruntime/objectstore/datasystem_object_store.cpp +++ b/src/libruntime/objectstore/datasystem_object_store.cpp @@ -411,16 +411,6 @@ std::vector DSCacheObjectStore::QueryGlobalReference(const std::vectorReleaseGRefs(YR::utility::ParseRealJobId(remoteId)); - auto code = - YR::Libruntime::ConvertDatasystemErrorToCore(status.GetCode(), static_cast(status.GetCode())); - auto msg = status.GetMsg(); - return ErrorInfo(code, ModuleCode::DATASYSTEM, msg); -} - ErrorInfo DSCacheObjectStore::GenerateKey(std::string &key, const std::string &prefix, bool isPut) { // if DS-client is not initialized, do not init here, because it may cause memory occupation diff --git a/src/libruntime/objectstore/datasystem_object_store.h b/src/libruntime/objectstore/datasystem_object_store.h index ea496fc2..3b0e2b3f 100644 --- a/src/libruntime/objectstore/datasystem_object_store.h +++ b/src/libruntime/objectstore/datasystem_object_store.h @@ -75,8 +75,6 @@ public: std::vector QueryGlobalReference(const std::vector &objectIds) override; - ErrorInfo ReleaseGRefs(const std::string &remoteId) override; - ErrorInfo GenerateKey(std::string &key, const std::string &prefix, bool isPut) override; ErrorInfo GetPrefix(const std::string &key, std::string &prefix) override; diff --git a/src/libruntime/objectstore/memory_store.cpp b/src/libruntime/objectstore/memory_store.cpp index 4ab47eec..48b5f6a3 100644 --- a/src/libruntime/objectstore/memory_store.cpp +++ b/src/libruntime/objectstore/memory_store.cpp @@ -421,11 +421,6 @@ std::vector MemoryStore::QueryGlobalReference(const std::vectorReleaseGRefs(remoteId); -} - void MemoryStore::Clear() { std::lock_guard lock(mu); diff --git a/src/libruntime/objectstore/memory_store.h b/src/libruntime/objectstore/memory_store.h index 53ba53f5..469e23a1 100644 --- a/src/libruntime/objectstore/memory_store.h +++ b/src/libruntime/objectstore/memory_store.h @@ -97,7 +97,6 @@ public: std::pair> DecreGlobalReference(const std::vector &objectIds, const std::string &remoteId); std::vector QueryGlobalReference(const std::vector &objectIds); - ErrorInfo ReleaseGRefs(const std::string &remoteId); ErrorInfo GenerateKey(std::string &key, const std::string &prefix, bool isPut = true); ErrorInfo GenerateReturnObjectIds(const std::string &requestId, std::vector &returnObjs); diff --git a/src/libruntime/objectstore/object_store.h b/src/libruntime/objectstore/object_store.h index 28bb1e41..b72e6f80 100644 --- a/src/libruntime/objectstore/object_store.h +++ b/src/libruntime/objectstore/object_store.h @@ -87,7 +87,6 @@ public: return std::make_pair(ErrorInfo(), std::vector()); } virtual std::vector QueryGlobalReference(const std::vector &objectIds) = 0; - virtual ErrorInfo ReleaseGRefs(const std::string &remoteId) = 0; virtual ErrorInfo GenerateKey(std::string &key, const std::string &prefix, bool isPut) = 0; virtual ErrorInfo GetPrefix(const std::string &key, std::string &prefix) = 0; virtual void SetTenantId(const std::string &tenantId) = 0; diff --git a/test/libruntime/gw_client_test.cpp b/test/libruntime/gw_client_test.cpp index b48cbf03..6298e55e 100644 --- a/test/libruntime/gw_client_test.cpp +++ b/test/libruntime/gw_client_test.cpp @@ -1010,9 +1010,6 @@ TEST_F(GwClientTest, TestUnsupportedReq3) std::string errMsg = e.what(); ASSERT_EQ(errMsg, "ErrCode: 3003, ModuleCode: 20, ErrMsg: StateLoadAsync is not supported with gateway client"); } - - err = gwClient_->ReleaseGRefs("remoteId"); - ASSERT_EQ(err.Code(), ERR_PARAM_INVALID); } } // namespace test diff --git a/test/libruntime/libruntime_test.cpp b/test/libruntime/libruntime_test.cpp index db67dc08..0f1b34e9 100644 --- a/test/libruntime/libruntime_test.cpp +++ b/test/libruntime/libruntime_test.cpp @@ -1060,11 +1060,6 @@ TEST_F(LibruntimeTest, DecreaseReferenceTest) EXPECT_NO_THROW(lr->DecreaseReference(objIds)); } -TEST_F(LibruntimeTest, ReleaseGRefsTest) -{ - ASSERT_EQ(lr->ReleaseGRefs("remoteId").OK(), true); -} - TEST_F(LibruntimeTest, WaitTest) { ASSERT_EQ(lr->Wait({"objId"}, 1, 0)->readyIds.size(), 1); diff --git a/test/libruntime/mock/mock_datasystem.h b/test/libruntime/mock/mock_datasystem.h index 6308a910..44b95545 100644 --- a/test/libruntime/mock/mock_datasystem.h +++ b/test/libruntime/mock/mock_datasystem.h @@ -50,7 +50,6 @@ public: MOCK_METHOD((std::pair>), DecreGlobalReference, (const std::vector &objectIds, const std::string &remoteId), (override)); MOCK_METHOD(std::vector, QueryGlobalReference, (const std::vector &objectIds), (override)); - MOCK_METHOD(ErrorInfo, ReleaseGRefs, (const std::string &remoteId), (override)); MOCK_METHOD(ErrorInfo, GenerateKey, (std::string & key, const std::string &prefix, bool isPut), (override)); MOCK_METHOD(ErrorInfo, GetPrefix, (const std::string &key, std::string &prefix), (override)); MOCK_METHOD(ErrorInfo, CreateBuffer, diff --git a/test/libruntime/mock/mock_datasystem_client.cpp b/test/libruntime/mock/mock_datasystem_client.cpp index cd27f4ba..cb57ada8 100644 --- a/test/libruntime/mock/mock_datasystem_client.cpp +++ b/test/libruntime/mock/mock_datasystem_client.cpp @@ -176,11 +176,6 @@ int ObjectClient::QueryGlobalRefNum(const std::string &id) return 1; } -Status ObjectClient::ReleaseGRefs(const std::string &remoteClientId) -{ - return Status::OK(); -} - Status ObjectClient::GenerateKey(const std::string &prefix, std::string &key) { key = prefix; diff --git a/test/libruntime/object_store_test.cpp b/test/libruntime/object_store_test.cpp index 33c0cd68..2028a2d7 100644 --- a/test/libruntime/object_store_test.cpp +++ b/test/libruntime/object_store_test.cpp @@ -147,12 +147,6 @@ TEST_F(ObjectStoreTest, QueryGlobalReferenceTest) ASSERT_EQ(res.at(0), 1); } -TEST_F(ObjectStoreTest, ReleaseGRefsTest) -{ - auto err = objectStore_->ReleaseGRefs("remoteID"); - ASSERT_EQ(err.Code(), ErrorCode::ERR_OK); -} - TEST_F(ObjectStoreTest, GenerateKeyTest) { std::string key; -- Gitee From 177ab704625a837259c9a836d65c9e9073aa1d06 Mon Sep 17 00:00:00 2001 From: xiaoxiawang Date: Tue, 2 Dec 2025 19:41:03 +0800 Subject: [PATCH 3/5] Revert "fix" This reverts commit f4fb8bc7eb35cf39c06adf022514cd97f59afa59. --- api/python/yr/config.py | 11 +++++------ api/python/yr/config_manager.py | 2 +- api/python/yr/includes/libruntime.pxd | 1 + 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/python/yr/config.py b/api/python/yr/config.py index 1b73779e..2fb101bb 100644 --- a/api/python/yr/config.py +++ b/api/python/yr/config.py @@ -108,7 +108,7 @@ class Config: #: default is ``2 second``, limit: (0,300]. recycle_time: int = _DEFAULT_RECYCLE_TIME #: If ``True`` will use DataSystem in cluster client, default: ``False``. - in_cluster: bool = True + in_cluster: bool = False #: Auto generated by init. job_id: str = "" #: For out cluster https ssl. @@ -461,8 +461,7 @@ class InvokeOptions: #: selected for scheduling. preferred_anti_other_labels = False - resource_group_options: ResourceGroupOptions = field( - default_factory=ResourceGroupOptions) + resource_group_options: ResourceGroupOptions = field(default_factory=ResourceGroupOptions) """ Specify the ResourceGroup option, which includes resource_group_name and bundle_index. @@ -489,8 +488,7 @@ class InvokeOptions: """ #: Function group options. - function_group_options: FunctionGroupOptions = field( - default_factory=FunctionGroupOptions) + function_group_options: FunctionGroupOptions = field(default_factory=FunctionGroupOptions) #: Set environment variables when the instance starts. env_vars: Dict[str, str] = field(default_factory=dict) #: Number of retries for stateless functions. @@ -595,6 +593,7 @@ class InvokeOptions: f"invalid type for '{actual}', actual: {type(actual_value)}, expect: {expected_type}" ) + def check_options_range(self): """ Check whether the options are in the valid range. @@ -605,7 +604,7 @@ class InvokeOptions: "max_instances", "max_invoke_latency", "min_instances", - ] + ] for attr in attrs: value = getattr(self, attr) diff --git a/api/python/yr/config_manager.py b/api/python/yr/config_manager.py index a24d19ba..16b18b91 100644 --- a/api/python/yr/config_manager.py +++ b/api/python/yr/config_manager.py @@ -60,7 +60,7 @@ class ConfigManager: self.__ds_address = "" self.__connection_nums = None self.__log_level = logging.WARNING - self.__in_cluster = True + self.__in_cluster = False self.__deployment_config = DeploymentConfig() self.tls_config = None self.meta_config = None diff --git a/api/python/yr/includes/libruntime.pxd b/api/python/yr/includes/libruntime.pxd index 6a87ffdc..98355533 100644 --- a/api/python/yr/includes/libruntime.pxd +++ b/api/python/yr/includes/libruntime.pxd @@ -154,6 +154,7 @@ cdef extern from "src/libruntime/objectstore/device_buffer.h" nogil: CAUSAL "YR::Libruntime::ConsistencyType::CAUSAL" cdef cppclass CCreateParam "YR::Libruntime::CreateParam": + CWriteMode writeMode CConsistencyType consistencyType CCacheType cacheType -- Gitee From 5ac7b02224cc95d382d3414ba9a2d74aede2c856 Mon Sep 17 00:00:00 2001 From: xiaoxiawang Date: Tue, 2 Dec 2025 19:41:47 +0800 Subject: [PATCH 4/5] =?UTF-8?q?reason:=E5=88=A0=E9=99=A4ReleaseGRefs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/python/yr/config_manager.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api/python/yr/config_manager.py b/api/python/yr/config_manager.py index 16b18b91..186c5176 100644 --- a/api/python/yr/config_manager.py +++ b/api/python/yr/config_manager.py @@ -17,7 +17,6 @@ """config manager""" import logging -import os from yr.common import utils from yr.common.singleton import Singleton @@ -60,7 +59,7 @@ class ConfigManager: self.__ds_address = "" self.__connection_nums = None self.__log_level = logging.WARNING - self.__in_cluster = False + self.__in_cluster = True self.__deployment_config = DeploymentConfig() self.tls_config = None self.meta_config = None @@ -290,7 +289,7 @@ class ConfigManager: self.http_ioc_threads_num = conf.http_ioc_threads_num self.server_name = conf.server_name self.ns = conf.ns - self.working_dir = conf.working_dir if conf.working_dir else os.getcwd() + self.working_dir = conf.working_dir self.enable_ds_encrypt = conf.enable_ds_encrypt self.ds_public_key_path = conf.ds_public_key_path self.runtime_public_key_path = conf.runtime_public_key_path -- Gitee From 0c0ee1edb02382711632ae3f3b1b29220755f069 Mon Sep 17 00:00:00 2001 From: xiaoxiawang Date: Tue, 2 Dec 2025 19:43:13 +0800 Subject: [PATCH 5/5] =?UTF-8?q?reason:=E5=88=A0=E9=99=A4ReleaseGRefs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/python/yr/config.py | 11 ++++++----- api/python/yr/includes/libruntime.pxd | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/python/yr/config.py b/api/python/yr/config.py index 2fb101bb..1b73779e 100644 --- a/api/python/yr/config.py +++ b/api/python/yr/config.py @@ -108,7 +108,7 @@ class Config: #: default is ``2 second``, limit: (0,300]. recycle_time: int = _DEFAULT_RECYCLE_TIME #: If ``True`` will use DataSystem in cluster client, default: ``False``. - in_cluster: bool = False + in_cluster: bool = True #: Auto generated by init. job_id: str = "" #: For out cluster https ssl. @@ -461,7 +461,8 @@ class InvokeOptions: #: selected for scheduling. preferred_anti_other_labels = False - resource_group_options: ResourceGroupOptions = field(default_factory=ResourceGroupOptions) + resource_group_options: ResourceGroupOptions = field( + default_factory=ResourceGroupOptions) """ Specify the ResourceGroup option, which includes resource_group_name and bundle_index. @@ -488,7 +489,8 @@ class InvokeOptions: """ #: Function group options. - function_group_options: FunctionGroupOptions = field(default_factory=FunctionGroupOptions) + function_group_options: FunctionGroupOptions = field( + default_factory=FunctionGroupOptions) #: Set environment variables when the instance starts. env_vars: Dict[str, str] = field(default_factory=dict) #: Number of retries for stateless functions. @@ -593,7 +595,6 @@ class InvokeOptions: f"invalid type for '{actual}', actual: {type(actual_value)}, expect: {expected_type}" ) - def check_options_range(self): """ Check whether the options are in the valid range. @@ -604,7 +605,7 @@ class InvokeOptions: "max_instances", "max_invoke_latency", "min_instances", - ] + ] for attr in attrs: value = getattr(self, attr) diff --git a/api/python/yr/includes/libruntime.pxd b/api/python/yr/includes/libruntime.pxd index 98355533..6a87ffdc 100644 --- a/api/python/yr/includes/libruntime.pxd +++ b/api/python/yr/includes/libruntime.pxd @@ -154,7 +154,6 @@ cdef extern from "src/libruntime/objectstore/device_buffer.h" nogil: CAUSAL "YR::Libruntime::ConsistencyType::CAUSAL" cdef cppclass CCreateParam "YR::Libruntime::CreateParam": - CWriteMode writeMode CConsistencyType consistencyType CCacheType cacheType -- Gitee