1. Bitbucket Website
  2. Public Issue Tracker
  3. master

Issues

Issue #9204 resolved

Post hook request duplicated after 20 sec timeout

mytharcher
created an issue

I am using post hook to deploy my code to Dreamhost.

In a new project of mine, I need to do a batch of tasks after hook post (including git pull, shell script packing and Java YUI), and this may take a long time to wait (about 30 sec). Then I found some of my files got very confused and hard to understand, but if I just using shell to do same things, everything go well.

After I checked the HTTP access logs, I finally find that after every my push triggered the post hook, it would be triggered again in exact 20 seconds. This is my log:

131.103.20.165 - - [25/Mar/2014:22:37:31 -0700] "POST /git-hook.php HTTP/1.1" 200 184 "-" "Bitbucket.org" 
131.103.20.165 - - [25/Mar/2014:22:37:51 -0700] "POST /git-hook.php HTTP/1.1" 200 184 "-" "Bitbucket.org" 
131.103.20.165 - - [25/Mar/2014:22:49:44 -0700] "POST /git-hook.php HTTP/1.1" 200 184 "-" "Bitbucket.org" 
131.103.20.165 - - [25/Mar/2014:22:50:04 -0700] "POST /git-hook.php HTTP/1.1" 200 184 "-" "Bitbucket.org" 
131.103.20.165 - - [25/Mar/2014:22:56:13 -0700] "POST /git-hook.php HTTP/1.1" 200 184 "-" "Bitbucket.org" 
131.103.20.165 - - [25/Mar/2014:22:56:33 -0700] "POST /git-hook.php HTTP/1.1" 200 184 "-" "Bitbucket.org" 
131.103.20.165 - - [25/Mar/2014:22:58:14 -0700] "POST /git-hook.php HTTP/1.1" 200 184 "-" "Bitbucket.org" 
131.103.20.165 - - [25/Mar/2014:22:58:34 -0700] "POST /git-hook.php HTTP/1.1" 200 184 "-" "Bitbucket.org" 
131.103.20.165 - - [25/Mar/2014:23:08:47 -0700] "POST /git-hook.php HTTP/1.1" 200 184 "-" "Bitbucket.org" 
131.103.20.165 - - [25/Mar/2014:23:09:07 -0700] "POST /git-hook.php HTTP/1.1" 200 184 "-" "Bitbucket.org" 
131.103.20.165 - - [25/Mar/2014:23:10:50 -0700] "POST /git-hook.php HTTP/1.1" 200 184 "-" "Bitbucket.org" 
131.103.20.165 - - [25/Mar/2014:23:11:10 -0700] "POST /git-hook.php HTTP/1.1" 200 184 "-" "Bitbucket.org" 
131.103.20.165 - - [25/Mar/2014:23:14:57 -0700] "POST /git-hook.php HTTP/1.1" 200 184 "-" "Bitbucket.org" 
131.103.20.165 - - [25/Mar/2014:23:15:17 -0700] "POST /git-hook.php HTTP/1.1" 200 184 "-" "Bitbucket.org" 
131.103.20.165 - - [25/Mar/2014:23:21:06 -0700] "POST /git-hook.php HTTP/1.1" 200 184 "-" "Bitbucket.org" 
131.103.20.165 - - [25/Mar/2014:23:21:26 -0700] "POST /git-hook.php HTTP/1.1" 200 184 "-" "Bitbucket.org"

So I realized may it be the first post request timeout in 20 seconds, and Bitbucket just sent another?

Comments (6)

  1. Erik van Zijst staff

    We see this from time to time and this happens when remote servers fail to reply to our POST within 20 seconds. This makes Bitbucket assume the request failed due to a non-responsive server, or network problem and trigger an automatic retry.

    Can you verify that your server respond immediately? When you do a lot of heavy lifting in response to a Bitbucket POST, it is generally a good idea to not do that synchronously while keeping us waiting, but to accept the request and perform the heavy parts in a background job somewhere.

  2. Log in to comment