Giter Club home page Giter Club logo

Comments (6)

clakech avatar clakech commented on May 23, 2024

Ok. GitHub expect a response I less than 10 seconds
https://developer.github.com/v3/guides/best-practices-for-integrators/

In our case, policy-bot is too slow here.

Any clue to avoid this? Async config to run hook later would help.

from policy-bot.

bluekeyes avatar bluekeyes commented on May 23, 2024

Thanks for reporting this. I'm not sure about the 10 second timeout (which may be a different issue), but the initial error looks very similar to an issue on our Bulldozer application: palantir/bulldozer#149.

In that case, I found and fixed a potential race condition (palantir/go-githubapp#24) in the shared library used by both of these apps, but it seems like that was not the problem, and I haven't had a chance to debug further. Building a test binary with Go's race detector is probably the next step.

from policy-bot.

clakech avatar clakech commented on May 23, 2024

This 10 seconds requierement is documented in the github documentation:https://developer.github.com/v3/guides/best-practices-for-integrators/

GitHub expects that integrations respond within 10 seconds of receiving the webhook payload. If your service takes longer than that to complete, then GitHub terminates the connection and the payload is lost.

Thank you for the pointer to this bulldozer issue. (we are using bulldozer too) Maybe we have a cache issue here and we should not call github APIs so many times OR maybe we need to invalidate the cache when we change some github teams/config. Let's investigate deeper on this issue.

from policy-bot.

clakech avatar clakech commented on May 23, 2024

BTW, Github recommandation suggest to use another software architecture for this kind of bot:

Favor asynchronous work over synchronous
...
Since it's impossible to predict how fast your service will complete, you should do all of "the real work" in a background job. Resque (for Ruby), RQ (for Python), or RabbitMQ (for Java) are examples of libraries that can handle queuing and processing of background jobs.

Note that even with a background job running, GitHub still expects your server to respond within ten seconds. Your server needs to acknowledge that it received the payload by sending some sort of response. It's critical that your service performs any validations on a payload as soon as possible, so that you can accurately report whether your server will continue with the request or not.

from policy-bot.

clakech avatar clakech commented on May 23, 2024

We are confident with this timeout issue because we have a HTTP 499 error in our load-balancer (traefik) and that means we have a "Client Closed Request" from the Github side.

from policy-bot.

bluekeyes avatar bluekeyes commented on May 23, 2024

I believe the originally reported panic is fixed in 1.12.4; unfortunately, the panic occurred when there was a failure communicating with GitHub, so requests that previously panicked will still probably fail.

Any issues due to processing times higher than GitHub's timeout are still present and will probably require a bigger architecture change to solve.

from policy-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.