Skip to content

Instantly share code, notes, and snippets.

@agentzh
Created June 18, 2020 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agentzh/2fb39b7a78d877a01708285beac1c90b to your computer and use it in GitHub Desktop.
Save agentzh/2fb39b7a78d877a01708285beac1c90b to your computer and use it in GitHub Desktop.
diff --git a/runtime/transport/relay_v2.c b/runtime/transport/relay_v2.c
index 135951a8e..7a364efa5 100644
--- a/runtime/transport/relay_v2.c
+++ b/runtime/transport/relay_v2.c
@@ -272,9 +272,11 @@ static void _stp_transport_data_fs_stop(void)
if (atomic_read (&_stp_relay_data.transport_state) == STP_TRANSPORT_RUNNING) {
atomic_set (&_stp_relay_data.transport_state, STP_TRANSPORT_STOPPED);
del_timer_sync(&_stp_relay_data.timer);
- dbug_trans(0, "flushing...\n");
- if (_stp_relay_data.rchan)
- relay_flush(_stp_relay_data.rchan);
+ /* PR26131 we don't call relay_flush() here since relay_flush()
+ * has * race conditions with the relay reader (staprun) and
+ * would result in garbled data ('\0' sequences, for example)
+ * being read by the reader. also relay_close()
+ * will defer closing until all the data is sent out anyway. */
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment