Skip to content

Clarify the meaning of FLOW.close#486

Merged
samoht merged 1 commit intomirage:masterfrom
djs55:clarify-flow-close
Feb 17, 2016
Merged

Clarify the meaning of FLOW.close#486
samoht merged 1 commit intomirage:masterfrom
djs55:clarify-flow-close

Conversation

@djs55
Copy link
Copy Markdown
Member

@djs55 djs55 commented Jan 30, 2016

This patch extends the description of FLOW.close to include discussion
of the flow state when one side has called FLOW.close and the other
has not.

Hopefully this is not actually a change in intended meaning, as the
mirage tcp/ip stack already behavies this way: FLOW.close is
implemented by sending a FIN to the peer which terminates only one
side of the full-duplex connection. When the peer finishes transmitting
all of its data -- at some arbitrary later date -- it will also send a FIN
to close the remainder of the connection.

FLOW.close means I will not call write again, so the peer can
receive Eof once it has read all pending/buffered data. This patch
clarifies that, after calling close, I can still call read to
read data being written by the other side, until the other side also
calls close.

FLOW.close is a handshake with the peer: when the peer also calls
FLOW.close, both threads unblock and resources associated with the
connection can be freed.

Signed-off-by: David Scott dave.scott@docker.com

This patch extends the description of `FLOW.close` to include discussion
of the flow state when one side has called `FLOW.close` and the other
has not.

Hopefully this is not actually a change in intended meaning, as the
mirage tcp/ip stack already behavies this way: `FLOW.close` is
implemented by sending a `FIN` to the peer which terminates only one
side of the full-duplex connection. When the peer finishes transmitting
all of its data -- at some arbitrary later date -- it will also send a `FIN`
to close the remainder of the connection.

`FLOW.close` means I will not call `write` again, so the peer can
receive `Eof` once it has read all pending/buffered data. This patch
clarifies that, after calling `close`, I can still call `read` to
read data being written by the other side, until the other side also
calls `close`.

`FLOW.close` is a handshake with the peer: when the peer also calls
`FLOW.close`, both threads unblock and resources associated with the
connection can be freed.

Signed-off-by: David Scott <dave.scott@docker.com>
@yomimono
Copy link
Copy Markdown
Contributor

yomimono commented Feb 1, 2016

Thanks for the documentation work, @djs55 . This looks good to me.

samoht added a commit that referenced this pull request Feb 17, 2016
Clarify the meaning of `FLOW.close`
@samoht samoht merged commit a3af1e7 into mirage:master Feb 17, 2016
@samoht
Copy link
Copy Markdown
Member

samoht commented Feb 17, 2016

It looks so good that I HAVE to merge it :p

@djs55 djs55 deleted the clarify-flow-close branch February 17, 2016 19:17
@djs55
Copy link
Copy Markdown
Member Author

djs55 commented Feb 17, 2016

Thanks for your kind words, @yomimono and @samoht :-)

becomes determined, all further calls to [read flow] will result
in a [`Eof]. *)

(** [close flow] will flush all pending writes and signal the remote
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will flush -> flushes, signal -> signals

djs55 added a commit to djs55/mirage that referenced this pull request Jun 22, 2016
As reported by @dbuenzli on mirage#486

Signed-off-by: David Scott <dave@recoil.org>
djs55 added a commit to djs55/mirage that referenced this pull request Jun 22, 2016
As reported by @dbuenzli on mirage#486

Signed-off-by: David Scott <dave@recoil.org>
samoht pushed a commit to samoht/mirage that referenced this pull request Dec 18, 2019
When removing vertexes recursively, we fold over the children.
When several edges point to the same node, we would remove it, move on,
check if it's orphan again (and crash).

Fixes mirage#69, mirage#486
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants