Skip to content
Snippets Groups Projects
Commit df0f365c authored by Craig Tiller's avatar Craig Tiller
Browse files

Fix bad stream terminators

parent dd25ccbd
No related branches found
No related tags found
No related merge requests found
...@@ -151,6 +151,8 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx, ...@@ -151,6 +151,8 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx,
bool is_last_frame = bool is_last_frame =
is_last_data_frame && s->send_trailing_metadata != NULL && is_last_data_frame && s->send_trailing_metadata != NULL &&
grpc_metadata_batch_is_empty(s->send_trailing_metadata); grpc_metadata_batch_is_empty(s->send_trailing_metadata);
gpr_log(GPR_DEBUG, "sb:%d ldf:%d ilf:%d", send_bytes,
is_last_data_frame, is_last_frame);
grpc_chttp2_encode_data(s->id, &s->flow_controlled_buffer, send_bytes, grpc_chttp2_encode_data(s->id, &s->flow_controlled_buffer, send_bytes,
is_last_frame, &s->stats.outgoing, is_last_frame, &s->stats.outgoing,
&t->outbuf); &t->outbuf);
...@@ -181,11 +183,16 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx, ...@@ -181,11 +183,16 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx,
if (s->send_trailing_metadata != NULL && if (s->send_trailing_metadata != NULL &&
s->fetching_send_message == NULL && s->fetching_send_message == NULL &&
s->flow_controlled_buffer.length == 0) { s->flow_controlled_buffer.length == 0) {
grpc_chttp2_encode_header( if (grpc_metadata_batch_is_empty(s->send_trailing_metadata)) {
&t->hpack_compressor, s->id, s->send_trailing_metadata, true, grpc_chttp2_encode_data(s->id, &s->flow_controlled_buffer, 0, true,
t->settings[GRPC_ACKED_SETTINGS] &s->stats.outgoing, &t->outbuf);
[GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE], } else {
&s->stats.outgoing, &t->outbuf); grpc_chttp2_encode_header(
&t->hpack_compressor, s->id, s->send_trailing_metadata, true,
t->settings[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE],
&s->stats.outgoing, &t->outbuf);
}
s->send_trailing_metadata = NULL; s->send_trailing_metadata = NULL;
s->sent_trailing_metadata = true; s->sent_trailing_metadata = true;
if (!t->is_client && !s->read_closed) { if (!t->is_client && !s->read_closed) {
......
...@@ -228,10 +228,14 @@ class Job(object): ...@@ -228,10 +228,14 @@ class Job(object):
env.update(self._spec.environ) env.update(self._spec.environ)
env.update(self._add_env) env.update(self._add_env)
env = sanitized_environment(env) env = sanitized_environment(env)
penv = {}
penv.update(self._spec.environ)
penv.update(self._add_env)
self._start = time.time() self._start = time.time()
cmdline = self._spec.cmdline cmdline = self._spec.cmdline
if measure_cpu_costs: if measure_cpu_costs:
cmdline = ['time', '--portability'] + cmdline cmdline = ['time', '--portability'] + cmdline
print('\n\ncmdline: %s\nenv: %s\n' % (cmdline, penv))
try_start = lambda: subprocess.Popen(args=cmdline, try_start = lambda: subprocess.Popen(args=cmdline,
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,
stdout=self._tempfile, stdout=self._tempfile,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment