Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
AMBARI-25325 : Updating Transactional method as public, log Transacti…
…on failure (#3032)
  • Loading branch information
virajjasani authored and jonathan-hurley committed Jul 8, 2019
1 parent 9cae3c4 commit 7ec7ec3baa8c8690e2cc2f1e86ee1c85b4552846
Showing 1 changed file with 13 additions and 9 deletions.
@@ -190,7 +190,7 @@ private Long getActiveUpgradeRequestId(Cluster cluster) {
* @param requestId Request Id to search tasks for.
*/
@Transactional
void retryHoldingCommandsInRequest(Long requestId) {
public void retryHoldingCommandsInRequest(Long requestId) {
if (requestId == null) {
return;
}
@@ -294,13 +294,17 @@ private boolean canRetryCommand(HostRoleCommandEntity hrc) {
* @param hrc Host Role Command entity
*/
private void retryHostRoleCommand(HostRoleCommandEntity hrc) {
hrc.setStatus(HostRoleStatus.PENDING);
hrc.setStartTime(-1L);
// Don't change the original start time.
hrc.setEndTime(-1L);
hrc.setLastAttemptTime(-1L);

// This will invalidate the cache, as expected.
m_hostRoleCommandDAO.merge(hrc);
try {
hrc.setStatus(HostRoleStatus.PENDING);
hrc.setStartTime(-1L);
// Don't change the original start time.
hrc.setEndTime(-1L);
hrc.setLastAttemptTime(-1L);
// This will invalidate the cache, as expected.
m_hostRoleCommandDAO.merge(hrc);
} catch (Exception e) {
LOG.error("Error while updating hostRoleCommand. Entity: {}", hrc, e);
throw e;
}
}
}

0 comments on commit 7ec7ec3

Please sign in to comment.