It'd be nice to improve the generated documentation of the relationships to indicate if a flow file is going to be penalized when transferred into a relationship. That could help users not to "self loop" a relationship when flow files are not penalized and to actually better understand observed behaviors.
As far I can see, we always follow the below pattern:
What I suggest is to have something like:
And, in the 'transfer' method implementation, check if the 'Relationship' has the penalize flag to penalize (or not) the flow file.
Problem is: we have cases where we route to the same relationship penalized AND non penalized flow files. I'm wondering if that's a valid approach. IMO we penalize a flow file when we expect the relationship to be self looped and when the cause could be resolved later. We penalize the flow file to avoid resource exhaustion by having a processor continually reprocessing the same flow file. However... if we have penalized and non-penalized flow files routed to the same relationship, are we not exposing the users to some risks? Should we have a 'retry' relationship or ensure that we're penalizing all the flow files?