Skip to content

Commit 8cc9b9e

Browse files
Fix mutex double locking when the callback is executed sync.
Fix mutex double locking when the callback is executed sync. Relates-To: OLPEDGE-667 Signed-off-by: Mykhailo Kuchma <[email protected]>
1 parent 397cd3f commit 8cc9b9e

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

olp-cpp-sdk-dataservice-write/src/IndexLayerClientImpl.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,7 @@ olp::client::CancellationToken IndexLayerClientImpl::InitApiClients(
133133
cancel_context->ExecuteOrCancelled(blobApi_function, cancel_function);
134134
};
135135

136-
auto configApi_function = [=]() -> olp::client::CancellationToken {
137-
return ApiClientLookup::LookupApi(self->apiclient_config_, "config", "v1",
138-
self->catalog_, configApi_callback);
139-
};
136+
ul.unlock();
140137

141138
return ApiClientLookup::LookupApi(apiclient_config_, "config", "v1", catalog_,
142139
configApi_callback);

olp-cpp-sdk-dataservice-write/src/VersionedLayerClientImpl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ olp::client::CancellationToken VersionedLayerClientImpl::InitApiClients(
151151
cancel_context->ExecuteOrCancelled(configApi_function, cancel_function);
152152
};
153153

154+
ul.unlock();
155+
154156
return ApiClientLookup::LookupApi(apiclient_metadata_, "metadata", "v1",
155157
catalog_, metadataApi_callback);
156158
}

olp-cpp-sdk-dataservice-write/src/VolatileLayerClientImpl.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,7 @@ olp::client::CancellationToken VolatileLayerClientImpl::InitApiClients(
165165
cancel_context->ExecuteOrCancelled(metadataApi_function, cancel_function);
166166
};
167167

168-
auto configApi_function = [=]() -> olp::client::CancellationToken {
169-
return ApiClientLookup::LookupApi(self->apiclient_config_, "config", "v1",
170-
self->catalog_, configApi_callback);
171-
};
168+
ul.unlock();
172169

173170
return ApiClientLookup::LookupApi(apiclient_config_, "config", "v1", catalog_,
174171
configApi_callback);

0 commit comments

Comments
 (0)