Skip to content

Commit

Permalink
Merge pull request grpc#10005 from ctiller/status_ordering
Browse files Browse the repository at this point in the history
Document status ordering rules
  • Loading branch information
a11r authored Mar 11, 2017
2 parents 1672b7e + 8918aae commit 0b7bd20
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions doc/status_ordering.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Ordering Status and Reads in the gRPC API
-----------------------------------------

Rules for implementors:
1. Reads and Writes Must not succeed after Status has been delivered.
2. OK Status is only delivered after all buffered messages are read.
3. Reads May continue to succeed after a failing write.
However, once a write fails, all subsequent writes Must fail,
and similarly, once a read fails, all subsequent reads Must fail.
4. When an error status is known to the library, if the user asks for status,
the library Should discard messages received in the library but not delivered
to the user and then deliver the status. If the user does not ask for status
but continues reading, the library Should deliver buffered messages before
delivering status. The library MAY choose to implement the stricter version
where errors cause all buffered messages to be dropped, but this is not a
requirement.
3 changes: 3 additions & 0 deletions test/core/end2end/tests/streaming_error_response.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
*
*/

/** \file Verify that status ordering rules are obeyed.
\ref doc/status_ordering.md */

#include "test/core/end2end/end2end_tests.h"

#include <stdio.h>
Expand Down

0 comments on commit 0b7bd20

Please sign in to comment.