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

Plugins timeout for "huge users" #598

Closed
4 tasks done
lowlighter opened this issue Oct 24, 2021 Discussed in #596 · 12 comments
Closed
4 tasks done

Plugins timeout for "huge users" #598

lowlighter opened this issue Oct 24, 2021 Discussed in #596 · 12 comments

Comments

@lowlighter
Copy link
Owner

lowlighter commented Oct 24, 2021

This is a follow-up of #584

Since each plugin are independant (except for the base one which is required and has been patched in #584), some plugins may still have GitHub API timeouts, reported by the following message:

Something went wrong while executing your query. This may be the result of a timeout, or it could be a GitHub bug. Please include XXXX:XXXX:XXXXXX:XXXXXX:XXXXXXXX when reporting this issue

This issue will be used to track these faulty plugins and eventually change their queries to make them work for "huge users"

If you encounter this issue on a plugin not listed below, don't hesitate to post it here (and tell on which user it occurs if it's not yourself) so it can eventually be patched


Plugins:

  • base
  • reactions -> (this one skips errors but should auto-fix itself when graphql api won't fail for issues endpoints)
  • followup -> (should be fixed with refacto of this plugin which also added indepth in feat(plugins/followup): add indepth mode #627)
  • isocalendar
@lowlighter
Copy link
Owner Author

Reactions plugin is actually broken, but it's probably coming from GitHub API itself since this simple query make it die 99% of time:

Query
query ReactionsDefault {
  user(login: "lowlighter") {
    login
    issues(first: 1, orderBy: {field: UPDATED_AT, direction: DESC}) {
      edges {
        cursor
        node {
          createdAt
          reactions(last: 1, orderBy: {field: CREATED_AT, direction: DESC}) {
            nodes {
              content
              user {
                login
              }
            }
          }
        }
      }
    }
  }
}

@gaocegege
Copy link

I ask GitHub support for help on this issue. Here is the reply:

Yeah, as the message indicated -- you hit a timeout there. The API has a timeout on processing requests and if that timeout is hit, the request is terminated and you get back an error. Currently, the timeout is 10 seconds.

This normally happens when your query involves too much data, so the way to avoid timeouts is to write smaller queries. If you have a query which touches a lot of data -- split it into several smaller queries and execute them separately.

@lowlighter
Copy link
Owner Author

I ask GitHub support for help on this issue. Here is the reply:

Yeah, as the message indicated -- you hit a timeout there. The API has a timeout on processing requests and if that timeout is hit, the request is terminated and you get back an error. Currently, the timeout is 10 seconds.
This normally happens when your query involves too much data, so the way to avoid timeouts is to write smaller queries. If you have a query which touches a lot of data -- split it into several smaller queries and execute them separately.

Yeah most of the time it's indeed because the query is too huge (for some users).

However the query linked above should work, it's only fetching one issue with one reaction but it timeout (for some reason it seems to happens when one try to fetch user login of said reaction)

@jayvdb
Copy link
Contributor

jayvdb commented Oct 30, 2021

Just noting I havent seen any problems with followup or isocalendar. Only reactions is failing.

I've also tried a simple query in https://docs.github.com/en/graphql/overview/explorer , and get back unicorns. All variations of the following fail.

query ReactionsDefault {
  user(login: "jayvdb") {
    login
    issues(last: 1) {
      edges {
        node {
          reactions(last: 1) {
            nodes {
              user {
                login
              }
            }
          }
        }
      }
    }
  }
}

@jayvdb
Copy link
Contributor

jayvdb commented Oct 30, 2021

So .. how does https://github.com/vvo/sourcekarma/ do it ? vvo/sourcekarma#18 prevents me from seeing if it has similar problems.

@lowlighter
Copy link
Owner Author

Just noting I havent seen any problems with followup or isocalendar. Only reactions is failing.

Yeah it really depends on user. #645 reported that there are issue with the followup for example

So .. how does https://github.com/vvo/sourcekarma/ do it ? vvo/sourcekarma#18 prevents me from seeing if it has similar problems.

Hum I'm not sure actually, last time I checked I was not able to find the relevant code (I think only the vercel web app is exposed but I'm not sure).

It's possible that the REST api is used instead, but I don't know.
However the GraphQL failing for a single issue is definitely a GitHub bug, I don't think it's expected to timeout for a simple query

@gaocegege
Copy link

Should we ask for GitHub Help?

@lowlighter
Copy link
Owner Author

Maybe for the reaction query yeah

@gaocegege
Copy link

I opened one ticket for it. Will keep track of the process here.

@gaocegege
Copy link

Here is the response from GitHub support:

Thanks for reaching out.

I took a look at the logs and it seems you're hitting timeouts on our end even on that simple query.

There's anything you can do about the timeout and I think this is something the team on our end needs to look at and see what we can do to optimize the execution of that query --so I have passed this specific feedback along to them. I can't promise an ETA, but we'll follow up if there's any news.

Regards,

GitHub Support

@lowlighter
Copy link
Owner Author

Nice, thanks a lot for reaching them and let us know that they'll eventually work on it!

@lowlighter
Copy link
Owner Author

Mentioned plugins were updated to support users with larger amount of data as far as possible.
Also the query used by the reaction plugins seems to have been fixed by GitHub

I'll close this issue, if you encounter other issue related to timeout you can report them back into discussions so it gets investigated 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants