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

Duplicate download detection seems not to be working #315

Open
MattBlissett opened this issue Sep 29, 2023 · 0 comments
Open

Duplicate download detection seems not to be working #315

MattBlissett opened this issue Sep 29, 2023 · 0 comments

Comments

@MattBlissett
Copy link
Member

MattBlissett commented Sep 29, 2023

We have code that is supposed to prevent a user from submitting identical download requests in a short interval:

// Check for recent user downloads (of this same user) with the same predicate
PagingResponse<Download> userDownloads =
occurrenceDownloadService.listByUser(
userAuthenticated.getName(),
new PagingRequest(0, 50),
EnumSet.of(PREPARING, RUNNING, SUCCEEDED),
LocalDateTime.now().minus(4, ChronoUnit.HOURS),
false);
String existingUserDownload = matchExistingDownload(userDownloads, predicateDownloadRequest);
if (existingUserDownload != null) {
return existingUserDownload;
}

However, there are duplicate downloads — hash is the MD5sum of the filter:

  status   │           key           │     format     │ size_gb │            created            │               md5                │              
───────────┼─────────────────────────┼────────────────┼─────────┼───────────────────────────────┼──────────────────────────────────┼
 SUCCEEDED │ 0264549-230224095556074 │ SIMPLE_CSV     │     212 │ 2023-05-28 13:58:03.559294+00 │ 4d98ea545c5b5cc7fa1fcfbee587dbd8 │
 SUCCEEDED │ 0264553-230224095556074 │ SIMPLE_CSV     │     212 │ 2023-05-28 14:02:22.877401+00 │ 4d98ea545c5b5cc7fa1fcfbee587dbd8 │
 SUCCEEDED │ 0264554-230224095556074 │ SIMPLE_CSV     │     212 │ 2023-05-28 14:02:30.244787+00 │ 4d98ea545c5b5cc7fa1fcfbee587dbd8 │
 SUCCEEDED │ 0264567-230224095556074 │ SIMPLE_CSV     │     212 │ 2023-05-28 14:33:13.458542+00 │ 4d98ea545c5b5cc7fa1fcfbee587dbd8 │
 SUCCEEDED │ 0264573-230224095556074 │ SIMPLE_CSV     │     212 │ 2023-05-28 14:46:41.546757+00 │ 4d98ea545c5b5cc7fa1fcfbee587dbd8 │
 SUCCEEDED │ 0264574-230224095556074 │ SIMPLE_CSV     │     212 │ 2023-05-28 14:46:49.502762+00 │ 4d98ea545c5b5cc7fa1fcfbee587dbd8 │

 SUCCEEDED │ 0159495-230224095556074 │ SIMPLE_CSV     │     264 │ 2023-04-11 06:59:10.942603+00 │ 7f8d83b63d0c620de6f366741724597a │ 
 SUCCEEDED │ 0159570-230224095556074 │ SIMPLE_CSV     │     264 │ 2023-04-11 07:28:32.897055+00 │ 7f8d83b63d0c620de6f366741724597a │ 
 SUCCEEDED │ 0159571-230224095556074 │ SIMPLE_CSV     │     264 │ 2023-04-11 07:28:41.082502+00 │ 7f8d83b63d0c620de6f366741724597a │ 

 SUCCEEDED │ 0260165-230224095556074 │ DWCA           │     208 │ 2023-05-24 20:31:03.228036+00 │ be9885a3a2ecc9fdf7eecd22900f4986 │ 
 SUCCEEDED │ 0260166-230224095556074 │ DWCA           │     208 │ 2023-05-24 20:31:10.732704+00 │ be9885a3a2ecc9fdf7eecd22900f4986 │ 

This wastes a lot of space, we should check why the code isn't working, and should probably extend the time for duplicates from 4 to 24 hours.

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

No branches or pull requests

1 participant