flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tillrohrmann <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-1489] Fixes blocking scheduleOrUpdateCo...
Date Tue, 10 Feb 2015 15:33:44 GMT
Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/378#discussion_r24420364
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java
---
    @@ -416,13 +426,26 @@ boolean scheduleOrUpdateConsumers(List<List<ExecutionEdge>>
consumers) throws Ex
     			final ExecutionState consumerState = consumerVertex.getExecutionState();
     
     			if (consumerState == CREATED) {
    -				if (state == RUNNING) {
    -					if (!consumerVertex.scheduleForExecution(consumerVertex.getExecutionGraph().getScheduler(),
false)) {
    -						success = false;
    +				consumerVertex.cachePartitionInfo(PartialPartitionInfo.fromEdge(edge));
    +
    +				future(new Callable<Boolean>(){
    +					@Override
    +					public Boolean call() throws Exception {
    +						try {
    +							consumerVertex.scheduleForExecution(
    +								consumerVertex.getExecutionGraph().getScheduler(), false);
    +						} catch (Exception exception) {
    +							fail(new IllegalStateException("Could not schedule consumer " +
    +									"vertex " + consumerVertex, exception));
    +						}
    +
    +						return true;
     					}
    -				}
    -				else {
    -					success = false;
    +				}, AkkaUtils.globalExecutionContext());
    +
    +				// double check to resolve race conditions
    +				if(consumerVertex.getExecutionState() == RUNNING){
    +					consumerVertex.sendPartitionInfos();
    --- End diff --
    
    The UpdateTask messages are idempotent in the ```BufferReader```. But my intention was
not to send any UpdateTask messages twice. The ```ConcurrentLinkedQueue``` should make sure
that every element is only dequeued once.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message