haskell-distributed / haskell-distributed/distributed-process

Third call to receive after endpoint close will can't be finished

Open
#436 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

network-transport-tcp
Dominant language
Haskell
Stars
751
Forks
99
Avg merge
45m
Merged PRs (30d)
2

Description

receive function n-t-tcp is implemented in such a way that first call to receive after EndPoint closed will return a chunk that will be evaluated to UserError "EndPointClosed" and next one will never finish.
Simple test:

   Right transport1 <- createTransport "127.0.0.1" "0" defaultTCPParameters
  Right ep1        <- newEndPoint transport1
  closeEndPoint ep1
  EndPointClosed <- receive ep1
  Right _ <- trySome $ receive ep1
  _ <- receive ep1

see https://github.com/haskell-distributed/network-transport-tcp/blob/master/src/Network/Transport/TCP.hs#L704-L717

I'm not sure if this a problem, because use should not call receive after we had EndPointClosed event, maybe only in multithreaded case

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the sequence in the issue, focusing on the third receive after close. Read Network.Transport.TCP.hs around lines 704-717 and determine the expected behavior after EndPointClosed; done means the repeated receive behavior is covered by a test and no longer hangs, subject to the project's intended endpoint-close semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
distributed-systems, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.