This is an automated email from the ASF dual-hosted git repository.

qianzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 286e9aae8 Fixed a crash in Storage Local Resource ProviderProcess.
286e9aae8 is described below

commit 286e9aae82297cdba516eceaf2b91041c33a90f8
Author: Charles-Francois Natali <[email protected]>
AuthorDate: Mon Apr 18 20:11:30 2022 +0100

    Fixed a crash in Storage Local Resource ProviderProcess.
    
    `StorageLocalResourceProviderProcess::connected` can crash on a check
    that the current state is `DISCONNECTED` if the current state is
    `READY`, which can happen if the periodic reconciliation runs after
    disconnection.
    
    It can be reproduced by running
    `ContentType/AgentResourceProviderConfigApiTest.Add/0` in a loop,
    preferably with some CPU-intensive workload in the background to affect
    the timing.
    
    Update the check to allow `READY` as well.
---
 src/resource_provider/storage/provider.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/resource_provider/storage/provider.cpp 
b/src/resource_provider/storage/provider.cpp
index 1a202af95..b341f3e96 100644
--- a/src/resource_provider/storage/provider.cpp
+++ b/src/resource_provider/storage/provider.cpp
@@ -471,7 +471,8 @@ 
StorageLocalResourceProviderProcess::StorageLocalResourceProviderProcess(
 
 void StorageLocalResourceProviderProcess::connected()
 {
-  CHECK_EQ(DISCONNECTED, state);
+  CHECK(state == DISCONNECTED || state == READY)
+      << "Unexpected state: " << state;
 
   LOG(INFO) << "Connected to resource provider manager";
 

Reply via email to