grafana / pyroscope

Continuous Profiling Platform. Debug performance issues down to a single line of code
https://grafana.com/oss/pyroscope/
GNU Affero General Public License v3.0
9.79k stars 583 forks source link

fix request cancellations #939

Closed eh-am closed 2 years ago

eh-am commented 2 years ago

After https://github.com/pyroscope-io/pyroscope/pull/927 we ended up getting rid of Request Canceling, we have to get it back:

  1. Update the functions in the services to take an AbortController (Like this https://github.com/pyroscope-io/pyroscope/blob/main/webapp/javascript/services/appNames.ts#L9, but making it mandatory)
  2. Update the data fetching call to use (eg https://github.com/pyroscope-io/pyroscope/pull/927/files#diff-d6dda51d3d4ec84407a5925f924d35e47bb367777d3ff5a928bee70ccb4d5c07R366), just follow the compiler after step 1
  3. Update the components (where dispatch is called) to use the promise result, and call .abort in the callback (example https://redux-toolkit.js.org/api/createAsyncThunk#canceling-while-running)

We have to do this for most (all) requests.

shaleynikov commented 2 years ago

Here is a proof-of-concept on request cancellation feature, please review #1099