Skip to content

Fix waiting on all miniprotocols #5118

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

Draft
wants to merge 1 commit into
base: release/ouroboros-network-0.20
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
Expand Down Expand Up @@ -406,13 +407,18 @@ awaitAllResults :: MonadSTM m
awaitAllResults tok bundle = do
results <- readTVar (getMiniProtocolsVar tok bundle)
>>= sequence
return $ Map.foldMapWithKey
if any (\case
NotStarted -> True
_ -> False
) (Map.elems results)
then retry
else return $ Map.foldMapWithKey
(\num r -> case r of
Errored e -> SomeErrored [MiniProtocolException num e]
Returned a -> AllSucceeded (Map.singleton num a)
NotRunning (Right a) -> AllSucceeded (Map.singleton num a)
NotRunning (Left e) -> SomeErrored [MiniProtocolException num e]
NotStarted -> AllSucceeded mempty)
NotStarted -> error "Impossible NotStarted" )
results


Expand Down