-
Notifications
You must be signed in to change notification settings - Fork 205
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
Wait for index before completing package upload #2194
Conversation
dd90709
to
b55b41a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of thing for you to look into, mostly minor. Otherwise LGTM. 🙂
...r/sandbox/src/main/scala/com/digitalasset/platform/sandbox/services/admin/PollingUtils.scala
Outdated
Show resolved
Hide resolved
* @param ids The IDs of the uploaded packages | ||
* @return The result of the party allocation received originally, wrapped in a [[Future]] | ||
*/ | ||
private def pollUntilPersisted( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it would make sense to move this in PollingUtils
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you prefer to leave it here, it may be worth to cut on the parameters and call PollingUtils.pollUntilPersisted
with the actual values here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we use the same values for minWait
, maxWait
, and backoffProgression
, we could also hard-code them inside PollingUtils.pollUntilPersisted
. If we realize that we need different values for party and package checking, we can put them as parameters, but I doubt that will be the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test uses explicit values for minWait
, maxWait
, and backoffProgression
to check whether they behave correctly, so I will leave the parameters for now.
...ain/scala/com/digitalasset/platform/sandbox/services/admin/ApiPackageManagementService.scala
Outdated
Show resolved
Hide resolved
.../main/scala/com/digitalasset/platform/sandbox/services/admin/ApiPartyManagementService.scala
Outdated
Show resolved
Hide resolved
iteration, | ||
scheduler) | ||
.map { numberOfAttempts => | ||
logger.debug(s"Party $newParty available, read after $numberOfAttempts attempt(s)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to move this to the helper function itself somehow? Would that be possible?
...r/sandbox/src/main/scala/com/digitalasset/platform/sandbox/services/admin/PollingUtils.scala
Outdated
Show resolved
Hide resolved
This makes sure users can immediately query the new packages after the upload completed. Fixes #2066
…x/services/admin/PollingUtils.scala Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
…x/services/admin/PollingUtils.scala Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
…x/services/admin/ApiPackageManagementService.scala Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
…x/services/admin/ApiPartyManagementService.scala Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
7cf3e66
to
3683099
Compare
3683099
to
848717a
Compare
This PR factors out the main polling function of
ApiPartyManagementService
into a separate helper, and uses it from bothApiPartyManagementService
andApiPackageManagementService
.This makes sure users can immediately query new packages after the upload completed.
Fixes #2066