You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2019/07/08 23:35:09 UTC
[ambari] branch trunk updated: AMBARI-25325 : Updating
Transactional method as public, log Transaction failure (#3032)
This is an automated email from the ASF dual-hosted git repository.
jonathanhurley pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push:
new 7ec7ec3 AMBARI-25325 : Updating Transactional method as public, log Transaction failure (#3032)
7ec7ec3 is described below
commit 7ec7ec3baa8c8690e2cc2f1e86ee1c85b4552846
Author: Viraj Jasani <vj...@salesforce.com>
AuthorDate: Tue Jul 9 05:05:02 2019 +0530
AMBARI-25325 : Updating Transactional method as public, log Transaction failure (#3032)
---
.../state/services/RetryUpgradeActionService.java | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/services/RetryUpgradeActionService.java b/ambari-server/src/main/java/org/apache/ambari/server/state/services/RetryUpgradeActionService.java
index 6d4a908..712e84a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/services/RetryUpgradeActionService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/services/RetryUpgradeActionService.java
@@ -190,7 +190,7 @@ public class RetryUpgradeActionService extends AbstractScheduledService {
* @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 @@ public class RetryUpgradeActionService extends AbstractScheduledService {
* @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;
+ }
}
}