Allow to not send out the logStats e.g. to various plugins.

We use this functionality to not send the log stats for the beginWaitForSameRangeTransactions() method.

NOTE: This is an automated export. Changes were already LGTM'd internally.
This commit is contained in:
Michael Berlin 2017-03-30 20:30:26 -07:00
Родитель d2a4135fcb
Коммит 51dab81269
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -969,7 +969,7 @@ func (tsv *TabletServer) beginWaitForSameRangeTransactions(ctx context.Context,
// Use (potentially longer) -queryserver-config-query-timeout and not
// -queryserver-config-txpool-timeout (defaults to 1s) to limit the waiting.
ctx, tsv.QueryTimeout.Get(),
"waitForSameRangeTransactions", "waitForSameRangeTransactions", nil,
"", "waitForSameRangeTransactions", nil,
target, true /* isTx */, false, /* allowOnShutdown */
func(ctx context.Context, logStats *tabletenv.LogStats) error {
k, table := tsv.computeTxSerializerKey(ctx, logStats, sql, bindVariables)
@ -1240,7 +1240,10 @@ func (tsv *TabletServer) handlePanicAndSendLogStats(
logStats.Error = terr
}
}
if logStats != nil {
// Examples where we don't send the log stats:
// - ExecuteBatch() (logStats == nil)
// - beginWaitForSameRangeTransactions() (Method == "")
if logStats != nil && logStats.Method != "" {
logStats.Send()
}
}