Things to think about, what are the possible framing devices at your disposal? What about knowing the ending early helps the reader or how does it help the reader? How can you get those positives without giving away the ending?
One answer is genre.
If you are writing in a genre much of the emotion and logistics of the ending are known to the reader but they don't feel that deflated feeling one gets from hearing the ending too early.
You're comment is absolutely correct, setting expectations is a positive outcome of early framing devices.
There's also a technique where you start with an implausible set of circumstances give a freeze frame of that moment and ask the audience, "I bet you want to know how I ended up in a Santa costume riding a thanksgiving turkey as training regiment to my first marathon win... Well it all started when..."
Bad example, but you say 3 random things or show some bizzare outcome just flash the image at the end and then work the audience back too it.
In that case the novelty creates the open loop. You see this in movies a lot.
Thanks for your thoughtful comment.