kgeisz commented on code in PR #7203:
URL: https://github.com/apache/hbase/pull/7203#discussion_r2268030346
##########
hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBackupRestore.java:
##########
@@ -175,28 +205,25 @@ public void testBackupRestore() throws Exception {
runTestMulti();
}
- private void runTestMulti() throws IOException {
+ private void runTestMulti() throws Exception {
LOG.info("IT backup & restore started");
Thread[] workers = new Thread[numTables];
+ BackupAndRestoreThread[] backupAndRestoreThreads = new
BackupAndRestoreThread[numTables];
for (int i = 0; i < numTables; i++) {
final TableName table = tableNames[i];
- Runnable r = new Runnable() {
- @Override
- public void run() {
- try {
- runTestSingle(table);
- } catch (IOException e) {
- LOG.error("Failed", e);
- Assert.fail(e.getMessage());
- }
- }
- };
- workers[i] = new Thread(r);
+ BackupAndRestoreThread backupAndRestoreThread = new
BackupAndRestoreThread(table);
+ backupAndRestoreThreads[i] = backupAndRestoreThread;
+ workers[i] = new Thread(backupAndRestoreThread);
workers[i].start();
}
- // Wait all workers to finish
- for (Thread t : workers) {
- Uninterruptibles.joinUninterruptibly(t);
+ // Wait for all workers to finish and check for errors
Review Comment:
I see what you're saying. Like if we have BackupThread1 and BackupThread2,
and an exception occurs in BackupThread1, then the exception is thrown before
waiting for BackupThread2 to complete. I will make a change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]