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

Eliminate useless FFDC #30515

Merged
merged 1 commit into from
Jan 15, 2025
Merged
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015, 2024 IBM Corporation and others.
* Copyright (c) 2015, 2025 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -30,6 +30,7 @@
import java.nio.file.attribute.FileTime;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.time.Instant;
import java.util.stream.Stream;
Expand Down Expand Up @@ -268,7 +269,7 @@ public void updateServerLease(String recoveryIdentity, String recoveryGroup, boo
* @see com.ibm.ws.recoverylog.spi.SharedServerLeaseLog#deleteServerLease(java.lang.String)
*/
@Override
@FFDCIgnore({ NoSuchFileException.class, Throwable.class })
@FFDCIgnore({ FileNotFoundException.class, NoSuchFileException.class, Throwable.class })
public void deleteServerLease(final String recoveryIdentity, boolean isPeerServer) throws Exception {
if (tc.isEntryEnabled())
Tr.entry(tc, "deleteServerLease", this, recoveryIdentity, isPeerServer);
Expand Down Expand Up @@ -301,7 +302,10 @@ public void deleteServerLease(final String recoveryIdentity, boolean isPeerServe
Files.deleteIfExists(leaseFile);
Files.deleteIfExists(_serverInstallLeaseLogDir.resolve(recoveryIdentity + LOCK_SUFFIX));
}
} catch (FileNotFoundException | NoSuchFileException e) {
} catch (FileNotFoundException e) {
if (tc.isDebugEnabled())
Tr.debug(tc, "{0} is already deleted", _serverInstallLeaseLogDir);
} catch (NoSuchFileException e) {
if (tc.isDebugEnabled())
Tr.debug(tc, "{0} is already deleted", _serverInstallLeaseLogDir);
} catch (IOException e) {
Expand All @@ -325,7 +329,10 @@ public void deleteServerLease(final String recoveryIdentity, boolean isPeerServe
}

}
} catch (FileNotFoundException | NoSuchFileException e) {
} catch (FileNotFoundException e) {
if (tc.isDebugEnabled())
Tr.debug(tc, "{0} is already deleted", _serverInstallLeaseLogDir);
} catch (NoSuchFileException e) {
if (tc.isDebugEnabled())
Tr.debug(tc, "{0} is already deleted", _serverInstallLeaseLogDir);
} catch (IOException e) {
Expand All @@ -344,6 +351,7 @@ public void deleteServerLease(final String recoveryIdentity, boolean isPeerServe
* @see com.ibm.ws.recoverylog.spi.SharedServerLeaseLog#claimPeerLeaseForRecovery(java.lang.String, int)
*/
@Override
@FFDCIgnore(PrivilegedActionException.class)
public boolean claimPeerLeaseForRecovery(String recoveryIdentityToRecover, String myRecoveryIdentity, LeaseInfo leaseInfo) throws Exception {
if (tc.isEntryEnabled())
Tr.entry(tc, "claimPeerLeaseForRecovery", recoveryIdentityToRecover, myRecoveryIdentity, this);
Expand Down Expand Up @@ -442,7 +450,7 @@ public FileTime run() throws IOException {

// Don't want this to have "unexpired" the lease time
Files.setLastModifiedTime(leaseFile, newleaseTime);
} catch (IOException e) {
} catch (IOException | PrivilegedActionException e) {
// We're not expecting this to happen. Log the event
if (tc.isDebugEnabled())
Tr.debug(tc, "Caught an IOException - " + e);
Expand Down