Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Melodic
morphemic-preprocessor
Commits
4e447be7
Commit
4e447be7
authored
Nov 26, 2021
by
Marta Różańska
Browse files
Merge branch 'fix-empty-hostname' into 'morphemic-rc1.5'
Fix empty hostname See merge request
!215
parents
68ec66f7
85d67c83
Pipeline
#17676
passed with stages
in 29 minutes and 55 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
scheduling-abstraction-layer/src/main/java/org/activeeon/morphemic/PAGateway.java
View file @
4e447be7
...
...
@@ -475,7 +475,7 @@ public class PAGateway {
for
(
ByonNode
byonNode:
byonNodeList
){
List
<
IpAddress
>
tempListIP
=
byonNode
.
getIpAddresses
();
assert
!
tempListIP
.
isEmpty
();
byonIPs
=
byonIPs
+
tempListIP
.
get
(
0
).
getValue
()
+
","
;
byonIPs
=
byonIPs
+
tempListIP
.
get
(
0
).
getValue
()
.
replace
(
" "
,
""
)
+
","
;
}
// Collect the pamr router address and port number
try
{
...
...
scheduling-abstraction-layer/src/main/java/org/activeeon/morphemic/service/ByonUtils.java
View file @
4e447be7
...
...
@@ -16,6 +16,10 @@ public class ByonUtils {
private
ByonUtils
()
{}
static
final
int
MAX_CONNECTION_RETRIES
=
5
;
static
final
int
INTERVAL
=
5000
;
public
static
void
init
(
String
paURL
)
{
resourceManagerGateway
=
new
PAResourceManagerGateway
(
paURL
);
}
...
...
@@ -101,7 +105,9 @@ public class ByonUtils {
* @return The BYON Host Name
*/
public
static
String
getBYONHostname
(
String
nsName
)
{
LOGGER
.
info
(
"Getting the byon node host name for: "
+
nsName
);
List
<
String
>
nodeHostnames
=
new
LinkedList
<>();
int
retries
=
0
;
try
{
nodeHostnames
=
resourceManagerGateway
.
getAsyncDeployedNodesInformation
(
nsName
,
"hostname"
);
}
...
...
@@ -123,6 +129,22 @@ public class ByonUtils {
}
}
}
while
(
nodeHostnames
.
get
(
0
).
equals
(
""
))
{
LOGGER
.
warn
(
"The node host name is empty, retrying to get node information"
);
try
{
Thread
.
sleep
(
INTERVAL
);
nodeHostnames
=
resourceManagerGateway
.
getAsyncDeployedNodesInformation
(
nsName
,
"hostname"
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
" resourceManagerGateway threw an exception: "
+
e
);
}
if
(
retries
>
MAX_CONNECTION_RETRIES
)
{
LOGGER
.
error
(
"The node host name is empty after "
+
retries
+
" retries"
);
throw
new
IllegalStateException
(
"Node hostname is empty"
);
}
retries
++;
}
LOGGER
.
info
(
"The hostname is retrieved successfully: "
+
nodeHostnames
.
get
(
0
));
return
nodeHostnames
.
get
(
0
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment