You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by GitBox <gi...@apache.org> on 2022/11/16 02:46:26 UTC

[GitHub] [incubator-pekko] He-Pin opened a new pull request, #47: !str Eagerly fails flow if the future is already failed.

He-Pin opened a new pull request, #47:
URL: https://github.com/apache/incubator-pekko/pull/47

   If the future is already failed, it will fail the flow even if there is no downstream demands now.
   refs: https://github.com/akka/akka/pull/31728
   Which was reported first in akka/akka gitter
   
   This is a behavior change, eagarly failing align with the FailedSource.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko] He-Pin commented on a diff in pull request #47: !str Eagerly fails flow if the future is already failed.

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #47:
URL: https://github.com/apache/incubator-pekko/pull/47#discussion_r1281630464


##########
stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphStages.scala:
##########
@@ -381,27 +381,25 @@ import pekko.stream.stage._
     override def initialAttributes: Attributes = DefaultAttributes.futureSource
     override def createLogic(attr: Attributes) =
       new GraphStageLogic(shape) with OutHandler {
-        def onPull(): Unit = {
+        override def preStart(): Unit = {
           future.value match {
             case Some(completed) =>
               // optimization if the future is already completed
-              onFutureCompleted(completed)
+              handle(completed)

Review Comment:
   @nvollmar @pjfanning What's your option here



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko] pjfanning commented on a diff in pull request #47: !str Eagerly fails flow if the future is already failed.

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #47:
URL: https://github.com/apache/incubator-pekko/pull/47#discussion_r1290745170


##########
stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphStages.scala:
##########
@@ -381,27 +381,25 @@ import pekko.stream.stage._
     override def initialAttributes: Attributes = DefaultAttributes.futureSource
     override def createLogic(attr: Attributes) =
       new GraphStageLogic(shape) with OutHandler {
-        def onPull(): Unit = {
+        override def preStart(): Unit = {
           future.value match {
             case Some(completed) =>
               // optimization if the future is already completed
-              onFutureCompleted(completed)
+              handle(completed)

Review Comment:
   I don't see this change in behaviour to be a big issue. We'll need to release note it. I think most users would assume this is the way it was meant to work.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko] He-Pin commented on a diff in pull request #47: !str Eagerly fails flow if the future is already failed.

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #47:
URL: https://github.com/apache/incubator-pekko/pull/47#discussion_r1281630464


##########
stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphStages.scala:
##########
@@ -381,27 +381,25 @@ import pekko.stream.stage._
     override def initialAttributes: Attributes = DefaultAttributes.futureSource
     override def createLogic(attr: Attributes) =
       new GraphStageLogic(shape) with OutHandler {
-        def onPull(): Unit = {
+        override def preStart(): Unit = {
           future.value match {
             case Some(completed) =>
               // optimization if the future is already completed
-              onFutureCompleted(completed)
+              handle(completed)

Review Comment:
   @nvollmar @pjfanning @mdedetrich  What's your option here
   
   This is a behavior change, and when working with `flatmapConcat` which accept a `parallism` and `delayError` should take care of this thing.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko] mdedetrich commented on pull request #47: !str Eagerly fails flow if the future is already failed.

Posted by GitBox <gi...@apache.org>.
mdedetrich commented on PR #47:
URL: https://github.com/apache/incubator-pekko/pull/47#issuecomment-1332389888

   @He-Pin You need to rebase this


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko] He-Pin merged pull request #47: !str Eagerly fails flow if the future is already failed.

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin merged PR #47:
URL: https://github.com/apache/incubator-pekko/pull/47


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko] He-Pin commented on a diff in pull request #47: !str Eagerly fails flow if the future is already failed.

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #47:
URL: https://github.com/apache/incubator-pekko/pull/47#discussion_r1281628977


##########
stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphStages.scala:
##########
@@ -381,27 +381,25 @@ import pekko.stream.stage._
     override def initialAttributes: Attributes = DefaultAttributes.futureSource
     override def createLogic(attr: Attributes) =
       new GraphStageLogic(shape) with OutHandler {
-        def onPull(): Unit = {
+        override def preStart(): Unit = {
           future.value match {
             case Some(completed) =>
               // optimization if the future is already completed
-              onFutureCompleted(completed)
+              handle(completed)

Review Comment:
   This will can break up some code, because we change the existing behavior. 
   @mdedetrich 
   
   The `FailedSource` failing the stream ASAP. but maybe not this one?
   
   Especially when combine it with `flatmapConcat` with parallism materialization.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


[GitHub] [incubator-pekko] He-Pin commented on a diff in pull request #47: !str Eagerly fails flow if the future is already failed.

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #47:
URL: https://github.com/apache/incubator-pekko/pull/47#discussion_r1281628977


##########
stream/src/main/scala/org/apache/pekko/stream/impl/fusing/GraphStages.scala:
##########
@@ -381,27 +381,25 @@ import pekko.stream.stage._
     override def initialAttributes: Attributes = DefaultAttributes.futureSource
     override def createLogic(attr: Attributes) =
       new GraphStageLogic(shape) with OutHandler {
-        def onPull(): Unit = {
+        override def preStart(): Unit = {
           future.value match {
             case Some(completed) =>
               // optimization if the future is already completed
-              onFutureCompleted(completed)
+              handle(completed)

Review Comment:
   This will can break up some code, because we change the existing behavior. 
   @mdedetrich 
   
   The `FailedSource` failing the stream ASAP. but maybe not this one?
   
   Especially when combine it with `flatmapConcat` with parallism materialization.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org