Skip to content

[DP-112] spawn may leak messages when interrupted #202

Open
@qnikst

Description

@qnikst

[Imported from JIRA. Reported by Facundo Dominguez @facundominguez) as DP-112 on 2015-06-02 19:03:28]
{{spawn}} is waiting for some messages, but if it is interrupted, the messages may arrive at the mailbox without nobody ever reading them.

{code}
spawn :: NodeId -> Closure (Process ()) -> Process ProcessId
spawn nid proc = do
us <- getSelfPid
mRef <- monitorNode nid
sRef <- spawnAsync nid (cpDelayed us proc)
receiveWait [
matchIf ((DidSpawn ref _) -> ref == sRef) $ (DidSpawn _ pid) -> do
unmonitor mRef
send pid ()
return pid
, matchIf ((NodeMonitorNotification ref _ _) -> ref == mRef) $ _ ->
return (nullProcessId nid)
]
{code}

The only fix I see so far is to wrap the {{spawn}} definition with {{callLocal}}.

Activity

changed the title [-]spawn may leak messages when interrupted[/-] [+][DP-112] spawn may leak messages when interrupted[/+] on Jun 18, 2015
moved this to Backlog in Release 0.8on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @qnikst

        Issue actions

          [DP-112] spawn may leak messages when interrupted · Issue #202 · haskell-distributed/distributed-process