Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[syncd] Unlock vendor api lock if enabling diag shell #571

Merged
merged 1 commit into from
Mar 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion syncd/VendorSai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ sai_status_t VendorSai::set(
_In_ sai_object_id_t objectId,
_In_ const sai_attribute_t *attr)
{
MUTEX();
std::unique_lock<std::mutex> _lock(m_apimutex);
SWSS_LOG_ENTER();
VENDOR_CHECK_API_INITIALIZED();

Expand Down Expand Up @@ -222,6 +222,13 @@ sai_status_t VendorSai::set(

sai_object_meta_key_t mk = { .objecttype = objectType, .objectkey = { .key = { .object_id = objectId } } };

if (objectType == SAI_OBJECT_TYPE_SWITCH && attr && attr->id == SAI_SWITCH_ATTR_SWITCH_SHELL_ENABLE)
{
// in case of diagnostic shell, this vendor api can be blocking, so
// release lock here to not cause deadlock for other events in syncd
_lock.unlock();
}

return info->set(&mk, attr);
}

Expand Down