This is an automated email from the ASF dual-hosted git repository.

yaniv pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-amaterasu.git

commit 3b425859aaf7725e465e01c9f1e6e1b276f0f3b9
Author: Yaniv Rodenski <[email protected]>
AuthorDate: Wed Apr 24 09:45:34 2019 +1000

    handling container allocation issues
---
 .../kotlin/org/apache/amaterasu/leader/yarn/ApplicationMaster.kt    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/leader-yarn/src/main/kotlin/org/apache/amaterasu/leader/yarn/ApplicationMaster.kt
 
b/leader-yarn/src/main/kotlin/org/apache/amaterasu/leader/yarn/ApplicationMaster.kt
index 5aea775..aa1e0f3 100644
--- 
a/leader-yarn/src/main/kotlin/org/apache/amaterasu/leader/yarn/ApplicationMaster.kt
+++ 
b/leader-yarn/src/main/kotlin/org/apache/amaterasu/leader/yarn/ApplicationMaster.kt
@@ -230,7 +230,8 @@ class ApplicationMaster : KLogging(), 
AMRMClientAsync.CallbackHandler {
                 log.info("container ${container.id} allocated")
                 if (actionsBuffer.isNotEmpty()) {
                     val actionData = actionsBuffer.poll()
-                    val cd = async {
+                    //val cd = async {
+                    try {
                         log.info("container ${container.id} allocated")
 
                         val framework = 
frameworkFactory.getFramework(actionData.groupId)
@@ -251,6 +252,9 @@ class ApplicationMaster : KLogging(), 
AMRMClientAsync.CallbackHandler {
                         notifier.info("created container for 
${actionData.name} created")
                         //ctx.localResources.forEach { t: String, u: 
LocalResource ->  notifier.info("resource: $t = ${u.resource}") }
                         log.info("launching container succeeded: 
${container.id.containerId}; task: ${actionData.id}")
+                    } catch (e: Exception) {
+                        notifier.error("", "error launching container with 
${e.message} in ${ExceptionUtils.getStackTrace(e)}")
+                        requestContainer(actionData, container.resource)
                     }
                 }
             }

Reply via email to