-
-
Notifications
You must be signed in to change notification settings - Fork 492
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
[WIP] csw harvester encountering an empty page has to continue harvesting #3713
[WIP] csw harvester encountering an empty page has to continue harvesting #3713
Conversation
condition on next record not changing should suffice avoiding infinite loop. furthermore, empty page condition induce an random behaviour, harvesting will stop on a fully empty page, incomplete page are accepted, this depending on page size and records order.
log.warning("Forcing harvest end since numberOfRecordsReturned = 0"); | ||
break; | ||
} | ||
|
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.
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.
I'm missing something like
if (nextRecord !=null && nextRecord < start) {
log.warning(String.format("Forcing harvest end since nextRecord < start (nextRecord = %d, start = %d", nextRecord, start));
break;
}
@@ -389,13 +389,6 @@ private void searchAndAlign(CswServer server, Search s, Set<String> uuids, | |||
break; | |||
} | |||
|
|||
// Another way to escape from an infinite loop | |||
|
|||
if (returnedCount == 0) { |
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.
This check was introduced as a workaround to #1429. Would the harvester still work for a server not returning nextRecord
?
Some server aren't compliant with CSW specification. In some cases they can return a value different of 0 for nextRecord when the harvester has reached the end of the available results. This commit stops the harvesting loop if the value of `nextResult` returned by the server is smaller than the current `start` record. Could be a complement to geonetwork#3713.
condition on next record not changing should suffice avoiding infinite
loop. furthermore, empty page condition induce an random behaviour,
harvesting will stop on a fully empty page, incomplete page are accepted,
this depending on page size and records order.