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

Avoid infinite number of calls to listBlobs when doing prefix removals (e..g, gridset or layer removals) #1232

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

aaime
Copy link
Member

@aaime aaime commented Apr 18, 2024

I believe this one happened because of a Jackson behavioral change. The code use to check for the "next page" marker in a paged listing to be null, but it's getting an empty string instead. The object representing the response is being deserialized using jackson.

While I was at it, I've fixed also a couple of other issues in tests, which might be also due to behavioral changes, this time in Azure itself (a "a//b" path is not treated as "a/b" but as "a/<emtpyNameFolder/b").

@@ -154,7 +157,7 @@ public void testPutWithListener() throws MimeException, StorageException {
eq(tile.getLayerName()),
eq(tile.getGridSetId()),
eq(tile.getBlobFormat()),
anyString(),
anyStringOrNull(),
Copy link
Member Author

Choose a reason for hiding this comment

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

These are changes in Mockito behavior, previous version was matching null too, the current one does not.

break;
}
// marker will be empty if there is no next page
if (Strings.isNullOrEmpty(marker)) break;
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the actual fix for the high number of listBlob. It would just not get out of this loop.

deletesToClear.add(prefix);
}
}
if (!deletesToClear.isEmpty()) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Scheduled deletes stored in property files would not get removed if the folder was empty.

Copy link
Contributor

@dromagnoli dromagnoli left a comment

Choose a reason for hiding this comment

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

Looks good to me

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

Successfully merging this pull request may close these issues.

2 participants