cfflush does not flush to screen when called within an async .each()

Description

Instead of each iteration flushing to the screen, lucee waits until the entire async loop has finished to flush to the screen.

Environment

None

Activity

Show:

Brad Wood 19 March 2023 at 05:30

In acf 2021 using flush() in the arrayEach() callback with parallel set either true or false

Adobe has a bug where ANY VALUE passed to the parallel attribute will enable async. So you can’t pass false, you must not pass any argument at all. I thought for sure there was an Adobe ticket for this, but I can’t find one.

The error on Adobe is also a bug IMO. I’ll enter a ticket for it as well.

Pothys - MitrahSoft 16 March 2023 at 08:13

I've checked this ticket and confirmed the issue happened on the Lucee latest version 5.3.10.125-SNAPSHOT. when using flush() in the arrayEach() callback with parallel = true, the output are shows after all the parallel execution completed. when we set async=false, It outputs are shown on every single execution completed as expected.
In acf 2021 using flush() in the arrayEach() callback with parallel set either true or false throws an error like java.util.concurrent.ExecutionException: coldfusion.tagext.io.FlushTag$InvalidFlushLocationException: Unable to perform cfflush.

Brad Wood 10 March 2023 at 18:01

And for reference, here was a workaround we found while discussing this on Slack

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 10 March 2023 at 17:06
Updated 19 March 2023 at 05:30