lucasbru opened a new pull request, #24422:
URL: https://github.com/apache/kafka/pull/24422

   StreamsBuilder.build() always runs NodesWithRelaxedNullKeyJoinDownstream to 
find the repartition nodes that have no relaxed null-key join downstream, so 
that they can drop null-key records. The traversal recursed once per graph 
node, so a topology with a chain of several thousand processors failed with 
StackOverflowError on a default 1 MB thread stack, independent of the 
optimization config.
   
   This PR replaces the recursion with an iterative post-order traversal over 
an explicit stack. A node is still finalized only after all its children, and 
it is marked non-optimizable if any child has the relaxed join label or is 
non-optimizable, so the resulting set of nodes is the same as before. Nodes 
reached through several paths are handled by the visited check.
   
   StreamsBuilderTest gets a test that builds a 10,000-processor chain on a 
thread with a 1 MB stack. It fails with StackOverflowError without the change. 
RelaxedNullKeyRequirementJoinTest gets a case where the relaxed join is reached 
from the repartition node through two paths (two mapValues merged), to cover a 
child that has already been visited.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to