beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Work logged] (BEAM-5277) Python SDK wordcount fails due to side inputs in streaming mode
Date Mon, 03 Sep 2018 23:17:00 GMT

     [ https://issues.apache.org/jira/browse/BEAM-5277?focusedWorklogId=140721&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-140721
]

ASF GitHub Bot logged work on BEAM-5277:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Sep/18 23:16
            Start Date: 03/Sep/18 23:16
    Worklog Time Spent: 10m 
      Work Description: tweise closed pull request #6325: [BEAM-5277] Flink portable streaming:
Empty side input for ready windows
URL: https://github.com/apache/beam/pull/6325
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/runners/core-java/src/main/java/org/apache/beam/runners/core/SideInputHandler.java
b/runners/core-java/src/main/java/org/apache/beam/runners/core/SideInputHandler.java
index 1a6826d94b1..33bbe80dedc 100644
--- a/runners/core-java/src/main/java/org/apache/beam/runners/core/SideInputHandler.java
+++ b/runners/core-java/src/main/java/org/apache/beam/runners/core/SideInputHandler.java
@@ -148,12 +148,7 @@ public void addSideInputValue(PCollectionView<?> sideInput, WindowedValue<Iterab
   @Override
   public <T> T get(PCollectionView<T> view, BoundedWindow window) {
 
-    @Nullable Iterable<?> elements = getIterable(view, window);
-
-    if (elements == null) {
-      elements = Collections.emptyList();
-    }
-
+    Iterable<?> elements = getIterable(view, window);
     // TODO: Add support for choosing which representation is contained based upon the
     // side input materialization. We currently can assume that we always have a multimap
     // materialization as that is the only supported type within the Java SDK.
@@ -172,7 +167,6 @@ public void addSideInputValue(PCollectionView<?> sideInput, WindowedValue<Iterab
    * @param <T>
    * @return
    */
-  @Nullable
   public <T> Iterable<?> getIterable(PCollectionView<T> view, BoundedWindow
window) {
     @SuppressWarnings("unchecked")
     Coder<BoundedWindow> windowCoder =
@@ -183,8 +177,9 @@ public void addSideInputValue(PCollectionView<?> sideInput, WindowedValue<Iterab
     ValueState<Iterable<?>> state =
         stateInternals.state(StateNamespaces.window(windowCoder, window), stateTag);
 
-    // returns null when the side input is not ready
-    return state.read();
+    Iterable<?> elements = state.read();
+    // return empty collection when no side input was received for ready window
+    return (elements != null) ? elements : Collections.emptyList();
   }
 
   @Override


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 140721)
    Time Spent: 1h 20m  (was: 1h 10m)

> Python SDK wordcount fails due to side inputs in streaming mode
> ---------------------------------------------------------------
>
>                 Key: BEAM-5277
>                 URL: https://issues.apache.org/jira/browse/BEAM-5277
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-flink
>            Reporter: Maximilian Michels
>            Assignee: Thomas Weise
>            Priority: Major
>              Labels: portability
>             Fix For: 2.8.0
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> After BEAM-5250 is fixed, the wordcount fails with:
> {noformat}
> RuntimeError: java.lang.NullPointerException: Element processed by SDK before side input
is ready
>         at org.apache.beam.repackaged.beam_runners_flink_2.11.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:787)
>         at org.apache.beam.runners.flink.translation.functions.FlinkStreamingSideInputHandlerFactory$1.get(FlinkStreamingSideInputHandlerFactory.java:126)
>         at org.apache.beam.runners.fnexecution.state.StateRequestHandlers$StateRequestHandlerToSideInputHandlerFactoryAdapter.handleGetRequest(StateRequestHandlers.java:297)
>         at org.apache.beam.runners.fnexecution.state.StateRequestHandlers$StateRequestHandlerToSideInputHandlerFactoryAdapter.handle(StateRequestHandlers.java:267)
>         at org.apache.beam.runners.fnexecution.state.GrpcStateService$Inbound.onNext(GrpcStateService.java:121)
>         at org.apache.beam.runners.fnexecution.state.GrpcStateService$Inbound.onNext(GrpcStateService.java:109)
>         at org.apache.beam.vendor.grpc.v1.io.grpc.stub.ServerCalls$StreamingServerCallHandler$StreamingServerCallListener.onMessage(ServerCalls.java:248)
>         at org.apache.beam.vendor.grpc.v1.io.grpc.ForwardingServerCallListener.onMessage(ForwardingServerCallListener.java:33)
>         at org.apache.beam.vendor.grpc.v1.io.grpc.Contexts$ContextualizedServerCallListener.onMessage(Contexts.java:76)
>         at org.apache.beam.vendor.grpc.v1.io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.messagesAvailable(ServerCallImpl.java:263)
>         at org.apache.beam.vendor.grpc.v1.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1MessagesAvailable.runInContext(ServerImpl.java:683)
>         at org.apache.beam.vendor.grpc.v1.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
>         at org.apache.beam.vendor.grpc.v1.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         at java.lang.Thread.run(Thread.java:745)
>  [while running 'write/Write/WriteImpl/FinalizeWrite']
>         at org.apache.beam.runners.fnexecution.control.FnApiControlClient$ResponseStreamObserver.onNext(FnApiControlClient.java:157)
>         at org.apache.beam.runners.fnexecution.control.FnApiControlClient$ResponseStreamObserver.onNext(FnApiControlClient.java:140)
>         at org.apache.beam.vendor.grpc.v1.io.grpc.stub.ServerCalls$StreamingServerCallHandler$StreamingServerCallListener.onMessage(ServerCalls.java:248)
>         at org.apache.beam.vendor.grpc.v1.io.grpc.ForwardingServerCallListener.onMessage(ForwardingServerCallListener.java:33)
>         at org.apache.beam.vendor.grpc.v1.io.grpc.Contexts$ContextualizedServerCallListener.onMessage(Contexts.java:76)
>         at org.apache.beam.vendor.grpc.v1.io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.messagesAvailable(ServerCallImpl.java:263)
>         at org.apache.beam.vendor.grpc.v1.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1MessagesAvailable.runInContext(ServerImpl.java:683)
>         at org.apache.beam.vendor.grpc.v1.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
>         at org.apache.beam.vendor.grpc.v1.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         ... 1 more
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message