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

Start Galaxy Library timeout when running #1337

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* [UI]: Fixed issue with Biohansel pipeline being launched without selecting an option for a required parameter. See [PR 1356](https://github.com/phac-nml/irida/pull/1356)
* [Developer]: Unified validate sample names into one endpoint. See [PR 1353](https://github.com/phac-nml/irida/pull/1353)
* [Developer/UI]: Increased speed of Project Samples table export and added estimated coverage to Project Samples table and exports. See [PR 1360](https://github.com/phac-nml/irida/pull/1360)
* [Workflow]: Start the Galaxy Data Library timeout when an upload begins rather than when it is first queued up. See [PR 1337](https://github.com/phac-nml/irida/pull/1337)
* [Developer]: Added description and metadata to create & update project sample endpoints. See [PR 1359](https://github.com/phac-nml/irida/pull/1359)

## [22.05.5] - 2022/06/28
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
Expand Down Expand Up @@ -195,6 +196,7 @@ public Map<Path, String> filesToLibraryWait(Set<Path> paths,
throws UploadException {
checkNotNull(paths, "paths is null");
final int pollingTimeMillis = libraryPollingTime*1000;
final CountDownLatch transferRunningLatch = new CountDownLatch(1);

Map<Path, String> datasetLibraryIdsMap = new HashMap<>();

Expand All @@ -210,6 +212,9 @@ public Map<Path, String> filesToLibraryWait(Set<Path> paths,
Future<Void> waitForLibraries = executor.submit(new Callable<Void>(){
@Override
public Void call() throws Exception {
// this status checking task is now running
transferRunningLatch.countDown();

// wait for uploads to finish
for (Path path : paths) {
String datasetLibraryId = datasetLibraryIdsMap.get(path);
Expand Down Expand Up @@ -238,6 +243,9 @@ public Void call() throws Exception {
}
});

// wait until library job status checking is running
transferRunningLatch.await();

waitForLibraries.get(libraryUploadTimeout, TimeUnit.SECONDS);
} catch (RuntimeException | IOException e) {
throw new UploadException(e);
Expand Down