Fix deadlock in RemoteStore::queryPathInfoUncached()
This commit is contained in:
		
							parent
							
								
									7d21863bb3
								
							
						
					
					
						commit
						a4c1618876
					
				
					 1 changed files with 28 additions and 25 deletions
				
			
		| 
						 | 
					@ -297,6 +297,8 @@ void RemoteStore::queryPathInfoUncached(const Path & path,
 | 
				
			||||||
    Callback<std::shared_ptr<ValidPathInfo>> callback)
 | 
					    Callback<std::shared_ptr<ValidPathInfo>> callback)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
 | 
					        std::shared_ptr<ValidPathInfo> info;
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
            auto conn(connections->get());
 | 
					            auto conn(connections->get());
 | 
				
			||||||
            conn->to << wopQueryPathInfo << path;
 | 
					            conn->to << wopQueryPathInfo << path;
 | 
				
			||||||
            try {
 | 
					            try {
 | 
				
			||||||
| 
						 | 
					@ -311,7 +313,7 @@ void RemoteStore::queryPathInfoUncached(const Path & path,
 | 
				
			||||||
                bool valid; conn->from >> valid;
 | 
					                bool valid; conn->from >> valid;
 | 
				
			||||||
                if (!valid) throw InvalidPath(format("path '%s' is not valid") % path);
 | 
					                if (!valid) throw InvalidPath(format("path '%s' is not valid") % path);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        auto info = std::make_shared<ValidPathInfo>();
 | 
					            info = std::make_shared<ValidPathInfo>();
 | 
				
			||||||
            info->path = path;
 | 
					            info->path = path;
 | 
				
			||||||
            info->deriver = readString(conn->from);
 | 
					            info->deriver = readString(conn->from);
 | 
				
			||||||
            if (info->deriver != "") assertStorePath(info->deriver);
 | 
					            if (info->deriver != "") assertStorePath(info->deriver);
 | 
				
			||||||
| 
						 | 
					@ -323,6 +325,7 @@ void RemoteStore::queryPathInfoUncached(const Path & path,
 | 
				
			||||||
                info->sigs = readStrings<StringSet>(conn->from);
 | 
					                info->sigs = readStrings<StringSet>(conn->from);
 | 
				
			||||||
                conn->from >> info->ca;
 | 
					                conn->from >> info->ca;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        callback(std::move(info));
 | 
					        callback(std::move(info));
 | 
				
			||||||
    } catch (...) { callback.rethrow(); }
 | 
					    } catch (...) { callback.rethrow(); }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue