-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Closed
Labels
Feature:SearchQuerying infrastructure in KibanaQuerying infrastructure in KibanabugFixes for quality problems that affect the customer experienceFixes for quality problems that affect the customer experienceimpact:highAddressing this issue will have a high level of impact on the quality/strength of our product.Addressing this issue will have a high level of impact on the quality/strength of our product.loe:mediumMedium Level of EffortMedium Level of Effortv7.9.0
Description
While digging into search code noticed potential improvements around requests cancelation:
- When firing search requests we subscribe to abort signal
abort.signal.addEventListener('abort', () => {
cancel()
})
But it could happen that client already asked to abort request and it seems to handle that case we have to handle it separately:
e.g.:
const { abortSignal = null } = requestOptionsMap.get(request) || {};
if (abortSignal) {
if (abortSignal.aborted) {
abort();
} else {
abortSignal.addEventListener('abort', abort);
}
}
Such scenario happened to me in dashboard.
- I guess that every time we manually subscribe to abort event, we have to unsubscribe also? otherwise it is a memory leak.
abortSignal.addEventListener('abort', abort);. note: RxJS fromEvent handle unsubscribe when we unsubscribe from observable.
To confirm this is needed, for example, fetch polyfill does this: https://github.com/github/fetch/blob/master/fetch.js#L534
Metadata
Metadata
Assignees
Labels
Feature:SearchQuerying infrastructure in KibanaQuerying infrastructure in KibanabugFixes for quality problems that affect the customer experienceFixes for quality problems that affect the customer experienceimpact:highAddressing this issue will have a high level of impact on the quality/strength of our product.Addressing this issue will have a high level of impact on the quality/strength of our product.loe:mediumMedium Level of EffortMedium Level of Effortv7.9.0