-
Notifications
You must be signed in to change notification settings - Fork 49
rest streaming JSON response error #1377
Copy link
Copy link
Open
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
The gapic showcase tests added in this python PR uncovered an issue with the gapic showcase server. It seems that when using the StreamingSequence server in rest mode, if you request partial data before raising an error, it results in a broken JSON response
Reproduction
In a separate terminal:
we get:
we'd expect something like:
Speculation
Looking though the showcase server code, it looks like stream.send and ReportGRPCError are relevant. They seem to be using different methods to write to the same buffer. Maybe we need to change the flushing strategy?