Sanil15 commented on a change in pull request #1219: SAMZA-2373: Container
Placement Service (core functionality) for container move and restart
URL: https://github.com/apache/samza/pull/1219#discussion_r352917406
##########
File path:
samza-core/src/main/java/org/apache/samza/clustermanager/ContainerAllocator.java
##########
@@ -416,19 +411,32 @@ public void stop() {
/**
* Checks if a request has expired.
+ *
* @param request the request to check
* @return true if request has expired
*/
private boolean isRequestExpired(SamzaResourceRequest request) {
long currTime = Instant.now().toEpochMilli();
- boolean requestExpired = currTime -
request.getRequestTimestamp().toEpochMilli() > requestExpiryTimeout;
+ boolean requestExpired = currTime -
request.getRequestTimestamp().toEpochMilli() > getRequestTimeout(request);
if (requestExpired) {
LOG.info("Request for Processor ID: {} on host: {} with creation time:
{} has expired at current time: {} after timeout: {} ms.",
- request.getProcessorId(), request.getPreferredHost(),
request.getRequestTimestamp(), currTime, requestExpiryTimeout);
+ request.getProcessorId(), request.getPreferredHost(),
request.getRequestTimestamp(), currTime, getRequestTimeout(request));
}
return requestExpired;
}
+ /**
+ * Determines the request expiry timeout. Container placement actions like
move, restarts can optionally override
+ * request expiry timeout. Otherwise it defaults to { @code
requestExpiryTimeout }
+ */
+ private long getRequestTimeout(SamzaResourceRequest request) {
+ Optional<Duration> controlActionRequestExpirytimeout =
containerManager.getActionExpiryTimeout(request.getProcessorId());
Review comment:
`since a processor can have multiple requests during its lifetime`
But this only is valid when the resource request is in progress, and only
one can be active a time!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services