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

Retries now send the file correctly. #153

Merged
merged 3 commits into from
Feb 7, 2017

Conversation

adam-vessey
Copy link

JIRA Ticket: ISLANDORA-1901

What does this Pull Request do?

Prevent timeouts in the event PUT requests fail due to spurious HTTP 409 Conflict errors.

What's new?

Rewind the file handle when retrying.

How should this be tested?

Regression testing is about it... Spurious issues are spurious.

I've not yet actually tried, but I believe the timeout behaviour described in the ticket can be forced by making bad requests... which is to say, making a request with old last modified dates, resulting in an actual 409... So this PR would fail faster, avoiding the timeouts at least.

Additional Notes:

  • Does this change require documentation to be updated? No.
  • Does this change add any new dependencies? No.
  • Does this change require any other modifications to be made to the repository (ie. Regeneration activity, etc.)? No.
  • Could this change impact execution of existing code? No.

Interested parties

Maintainers: @DiegoPino and @willtp87

@willtp87
Copy link
Member

willtp87 commented Feb 3, 2017

@adam-vessey did you miss a commit?

@@ -689,7 +692,7 @@ function putRequest($url, $type = 'none', $file = NULL) {
// Ugly substitute for a try catch finally block.
$exception = NULL;
try {
$results = $this->doCurlRequest();
$results = $this->doCurlRequest(NULL, $fh);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case that the type of the put request is 'none', $fh isn't defined here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonathangreen @adam-vessey the absence of $fh seems to be handled by the argument 's default

This seems to consistent with the pre-pull way of doing it for $file, but I feel that maybe being explicit on a NULL $fh on type none would not harm at all.

Copy link

@DiegoPino DiegoPino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adam-vessey there is a missing pull for sure regarding tests that is making TRAVIS fail. @willtp87 is that the one you are referring to?

willtp87 and others added 2 commits February 3, 2017 10:12
... Was misdirected when the retry stuff was originally rolled.
@DiegoPino
Copy link

@adam-vessey this looks good. Will wait a few hours in case @jonathangreen has some comments. Will merge after that or today last hour in no comments. Thaks

@jonathangreen
Copy link

Looks good to me.

@DiegoPino DiegoPino merged commit 6f67b57 into Islandora:1.x Feb 7, 2017
@DiegoPino
Copy link

@adam-vessey and @jonathangreen thanks. Merged and JIRA ticket marked as Fixed.

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

Successfully merging this pull request may close these issues.

4 participants