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

The GraphQL request to GitHub API is failing python.cz build #287

Open
hroncok opened this issue Sep 17, 2018 · 11 comments
Open

The GraphQL request to GitHub API is failing python.cz build #287

hroncok opened this issue Sep 17, 2018 · 11 comments

Comments

@hroncok
Copy link
Member

hroncok commented Sep 17, 2018

I see:

ValueError: Unexpected status '500 INTERNAL SERVER ERROR' on URL /zapojse/

Every now and then. I often need to restart the build for the website to deploy.

Maybe the GitHub API call should have some retrying instead?

@honzajavorek
Copy link
Member

honzajavorek commented Sep 17, 2018 via email

@honzajavorek honzajavorek changed the title The Elsa/Travis build is flaky The GraphQL request to GitHub API is flaky Jan 24, 2019
@honzajavorek
Copy link
Member

Official reply from GitHub:

Thanks for reaching out about this. Our logs indicate that you've hit a timeout with that query, as the error message suggested as a possible cause. All API requests have a 10 second limit on execution time -- if that limit is reached, the request is terminated and you get back that error.

Because execution time is not deterministic and known in advance (e.g. may be impacted by current load on database or filesystem, or changes in the underlying data), this execution time varies a bit with each request you make, even though the query is the same. Our logs don't show us the exact query you are using, but I'm guessing it involves fetching more that a few objects. And it seems that the query takes around 10s to execute -- sometimes more (and then causing the error) and sometimes less (and then completing successfully and returning the results).

What you might do here is change the query so that fewer objects are needed to process it -- that should reduce the execution time so that it is consistently under 10s and you get back the results.

@honzajavorek
Copy link
Member

The steps to solve this would be:

  1. Decide whether the "Get Involved" page is useful in its current form
  2. If it's useful (which I personally doubt), try to optimize the GraphQL query
  3. If it's not useful, rethink the page and then implement it from scratch with the new ideas in mind

@honzajavorek
Copy link
Member

It's not flaky anymore. It is just failing. The last time it passed was a month ago.

@honzajavorek honzajavorek changed the title The GraphQL request to GitHub API is flaky The GraphQL request to GitHub API is failing python.cz build Aug 12, 2019
@honzajavorek
Copy link
Member

Interestingly, the page already was trying to be resilient, expecting "Zapoj se" to fail, catching and logging the exception while still rendering the page. The problem was, all the time, that the page returned 500 status code and that failed the Elsa build 🤦‍♂ I hotfixed it here: 93fc670

@frenzymadness
Copy link
Member

I think that the idea is still useful but the list should contain only easily fixable issues which are the best starting point for a new community member.

@honzajavorek
Copy link
Member

honzajavorek commented Aug 29, 2019 via email

@frenzymadness
Copy link
Member

@honzajavorek Could you please explain how it works now? I think that use a dedicated label (zapojse or more common easyfix) and list all issues with that label from all our organizations is what we want.

@honzajavorek
Copy link
Member

honzajavorek commented Aug 29, 2019 via email

@frenzymadness
Copy link
Member

With a query like this: {"query_string": "org:PyLadiesCZ is:issue state:open label:easyfix"} and GraphQL query:

query($query_string:String!) {
    search(first: 100, type: ISSUE, query: $query_string) {
      issueCount
      edges {
        node {
          ... on Issue {
            createdAt
            title
            url,
            repository {
              name
              url
            }
            author {
              login
              url
            }
          }
        }
      }
    }
}

I can imagine that it might work because the result will be smaller and will contain only issues we marked as good entry points for newcomers on purpose.

Then reason I am using $query_string as an input variable is that I cannot find a way how to put $org_name into query string in GraphQL.

IIRC @messa was working with GraphQL so he might be able to help us here.

@encukou
Copy link
Member

encukou commented Aug 22, 2023

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

No branches or pull requests

4 participants