influxdb/influxql
Ayan George ca2055c16c
refactor: Replace ctx.Done() with ctx.Err() (#19546)
* refactor: Replace ctx.Done() with ctx.Err()

Prior to this commit we checked for context cancellation with a select
block and context.Context.Done() without multiplexing over any other
channel like:

  select {
    case <-ctx.Done():
      // handle cancellation
    default:
      // fallthrough
  }

This commit replaces those type of blocks with a simple check of
ctx.Err().  This has the following benefits:

* Calling ctx.Err() is much faster than entering a select block.

* ctx.Done() allocates a channel when called for the first time.

* Testing the result of ctx.Err() is a reliable way of determininging if
  a context.Context value has been canceled.

* fix: Fix data race in execDeleteTagValueEntry()
2020-09-16 12:20:09 -04:00
..
control feat(influxql): Initial implementation of InfluxQL query engine 2020-08-14 12:37:30 -07:00
mock feat(influxql): Initial implementation of InfluxQL query engine 2020-08-14 12:37:30 -07:00
query refactor: Replace ctx.Done() with ctx.Err() (#19546) 2020-09-16 12:20:09 -04:00
errors.go feat(influxql): Initial implementation of InfluxQL query engine 2020-08-14 12:37:30 -07:00
query_request.go feat(influxql): Initial implementation of InfluxQL query engine 2020-08-14 12:37:30 -07:00
service.go feat(influxql): Initial implementation of InfluxQL query engine 2020-08-14 12:37:30 -07:00
statistics.go feat(influxql): Initial implementation of InfluxQL query engine 2020-08-14 12:37:30 -07:00