Skip to content

GH-4408: Fix overall timeout for multiple update operations - #4426

Open
deepikavalluru wants to merge 2 commits into
apache:mainfrom
deepikavalluru:fix-4408-update-timeout
Open

deepikavalluru wants to merge 2 commits into
apache:mainfrom
deepikavalluru:fix-4408-update-timeout

Conversation

@deepikavalluru

Copy link
Copy Markdown

GitHub issue resolved #

Pull request Description:

Fixes #4408.

The remaining overall timeout was incorrectly calculated for the second and subsequent update operations.

The local variable remainingOverallTimeoutMillis was initialized to -1 on every invocation. Subtracting the elapsed time from this value caused the remaining timeout to become zero, resulting in immediate cancellation.

This change calculates the remaining timeout using the original configured overall timeout minus the elapsed time.

Changes

  • Corrected the remaining overall timeout calculation.
  • Added a regression test covering multiple update operations with an overall timeout.

Testing

  • Regression test: TestUpdateTimeoutMultiOp
  • Full ARQ module test suite: passed.

  • Tests are included.
  • Documentation change and updates are provided for the Apache Jena website
  • Commits have been squashed to remove intermediate development commit messages.
  • Key commit messages start with the issue number (GH-xxxx)

By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the Contributor's Agreement.


See the Apache Jena "Contributing" guide.

.update(TWO_OPS)
.timeout(600, TimeUnit.SECONDS)
.execute());
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The test doesn't actually have any assertions in it, while I appreciate this is testing something that previously would have errored you still need to assert that the updates are now successfully applied

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for reviewing! I'll work on adding assertions to verify that the updates are successfully applied.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I've added assertions to verify that both update operations are successfully applied and reran the tests. The build is successful.

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.

UpdateExec: overall timeout cancels the second operation of a request immediately

2 participants