From 42e813a6f468c929c21976e6d5753e1c268d563f Mon Sep 17 00:00:00 2001 From: Harsh Rawat Date: Tue, 6 Feb 2024 00:00:37 +0530 Subject: [PATCH] fix bug where the lock was never released There is a typo/bug in the `GetAppliedStatus` method for FSx task resource wherein the lock is never released in the method. This will likely cause the agent to fail tasks with FSx volume since the lock on other methods will never be acquired. Presently, this method is not invoked from any workflow and therefore, we have not seen any impact. --- .../fsxwindowsfileserver/fsxwindowsfileserver_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/taskresource/fsxwindowsfileserver/fsxwindowsfileserver_windows.go b/agent/taskresource/fsxwindowsfileserver/fsxwindowsfileserver_windows.go index 271b25d90d7..51f595f5bf2 100644 --- a/agent/taskresource/fsxwindowsfileserver/fsxwindowsfileserver_windows.go +++ b/agent/taskresource/fsxwindowsfileserver/fsxwindowsfileserver_windows.go @@ -719,7 +719,7 @@ func (fv *FSxWindowsFileServerResource) updateAppliedStatusUnsafe(knownStatus re // GetAppliedStatus safely returns the currently applied status of the resource func (fv *FSxWindowsFileServerResource) GetAppliedStatus() resourcestatus.ResourceStatus { fv.lock.RLock() - defer fv.lock.RLock() + defer fv.lock.RUnlock() return fv.appliedStatusUnsafe }