Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search Aborted Error #1155

Merged
merged 4 commits into from
Oct 20, 2020
Merged

Search Aborted Error #1155

merged 4 commits into from
Oct 20, 2020

Conversation

jameskerr
Copy link
Member

If you issue a search, then issue another search before the first has completed, Brim will abort the fetch request of the first. This usually throws an error with the message: DOMException: the user aborted the request. However, in our app, we don't want to consider that an error case, since it's clearly what the user wanted to do. However, the error was still being thrown because we were not checking for the abort message in all three places an error can happen in a search:

  1. The "fetch" promise could reject with an error
  2. The zqd server could return an http error code
  3. The zqd server could end the search with an "error" key in the TaskEnd payload.

Previously, we were only checking one of those places for the abort error and skipping the error. Now I've made a single errored function that we use in all three places.

This will fix: #1152

I also inlined the callbacks to make it all more readable. I think it's better than scrolling up just to see what the handler does.

function errored(e) {
flushBufferLazy.cancel()
if (abortError(e)) {
resolve()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

I think the reason this test fails on CI is because of the tons of
promises that we request from the webdriver. It must have a limitted
pool of connections that it uses and we are maxing it out.
@jameskerr jameskerr merged commit 0159b23 into master Oct 20, 2020
@jameskerr jameskerr deleted the bug_abort branch October 20, 2020 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disruptive "The user aborted a request" notification
2 participants