haskell-distributed / haskell-distributed/distributed-process

[NTTCP-12] Fix potential locking when waiting on the crossed MVar

Open
#441 1 comment 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

[Imported from JIRA. Reported by Facundo Dominguez @facundominguez) as NTTCP-12 on 2015-05-27 20:55:45]
The handler of incomming requests is waiting on the {{crossed}} MVar before accepting an incoming connection.

This wait is potentially indefinite (if the CrossConnectRequest message does not arrive), and it looks unnecessary. At least I cannot come up with any problematic interleaving of events in the absence of it.

We should either remove the {{crossed}} MVar or document what is helping to accomplish (preferrably the problematic ordering of events that is being ruled out).

There is the commit [message|https://github.com/haskell-distributed/network-transport-tcp/commit/6207de60bae7fcf39c108a49bdc152a98abdd277] of the commit that introduces it. Unfortunately, it doesn't explain the "certain ordering of events" that motivates it.

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 with the incoming-request handler and the crossed MVar described in the issue, then read commit 6207de60bae7fcf39c108a49bdc152a98abdd277 for its original context. Determine whether the wait can be removed safely or document the ordering it protects; done means the locking concern is resolved and the rationale is explicit.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
distributed-systems
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.