haskell-distributed / haskell-distributed/distributed-process

A problem in connection closing.

Open
#429 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

* A send connect to B (lightid=1024)
  A.next_lightid = 1025
  A.outgoing = 1

* B send connect to A (lightid=1024)
  B.next_lightid = 1025
  B.outgoing = 1

* A send close connect to B
  A.outgoing = 0
  send CloseSocket to B (last_incoming=0)
  enter Closing state

* B send close connect to A
  B.outgoing = 0
  send CloseSocket to A (last_incoming=0)
  enter Closing state

* B got connect from A
  recover from Closing state.
  incomings.add(1024)

* B got close connect from A
  incomings.remove(1024)

* A got connect from B
  recover from Closing state.
  incomings.add(1024)

* A got close connect from B
  incomings.remove(1024)

In the end, both A and B's outgong==0 and incomings empty, but the heavyweight connection is not closed.
Maybe we should try CloseSocket again when we got close connection request, and find that outgoing==0 and incomings is empty?

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

Start by tracing the connection-closing state handling for the A/B sequence described in the issue, especially the transitions involving Closing, outgoing, and incomings. Reproduce the simultaneous connect-and-close scenario and verify that the heavyweight connection is closed once both outgoing is zero and incomings is empty.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
distributed-systems, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.