1. Atlassian Labs
  2. Atlassian Labs
  3. bamboo-continuous-plugin-deployment

Pull requests

#1 Declined
Repository
Deleted repository
Branch
master (4ad069ab04fa)
Repository
bamboo-continuous-plugin-deployment
Branch
master

BUILDENG-2873: Use a while loop instead of recursive polling

Author
  1. Min'an Tan
Reviewers
Description
No description
  • Learn about pull requests

Comments (5)

  1. Joe Clark

    I'm not sure this is a good solution. At least in the previous code, the recursive solution had a failure case where the task would fail and execution would cease (even if it was indeterminate). Now, theoretically, the task could run forever and never finish if the remote server does not return an expected response.

    You can see in the problematic bamboo build that a successful build (https://bamboo.extranet.atlassian.com/browse/TWENTYCENT-RA-RJC-953) usually only takes a minute, but the recent failure took over 8 minutes before the JVM stack was exhausted (https://bamboo.extranet.atlassian.com/browse/TWENTYCENT-RA-RJC-955).

    I think if you swap to a while loop, there should be a timeout at which point the loop execution is terminated.

  2. Joe Clark

    Confluence and JIRA generally give plugins a grace period of 60 seconds to finish enabling. I think 1-2 minutes for the task timeout would be appropriate. I can implement this if you are stretched for time; just let me know.

  3. Min'an Tan author

    Are you referring to the 400? As far as I can tell, the failure case is still in place because the TaskException would still be thrown in the loop if it got a 400.

    Fair call for the timeout, though I will leave it in your hands if you want to go down that path :)

  4. Joe Clark

    I'm saying that you probably can't guarantee that the remote server will ever return a HTTP error code. It may continue to perpetually return HTTP 200 OK responses to indicate that the plugin is still "installing". This seems to be what was happening in the current failing build - the remote server spent 8 minutes telling the client to keep polling before the task overflowed the stack.

    I'll add in a timeout, then commit and release.