[MAGNOLIA-2162] TryCommand, a MgnlCommand for trying other mgnl commands Created: 30/May/08  Updated: 04/Nov/15  Resolved: 04/Nov/15

Status: Closed
Project: Magnolia
Component/s: contributions
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Trivial
Reporter: John Mettraux Assignee: Philipp Bärfuss
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File TryCommand.java     PNG File tryactivate.png    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

I've implemented a TryCommand, it's a magnolia command that tries a
certain number of time to execute another command. It can try a
certain number of times before calling it quit (see the example
configuration in the PNG file).

I didn't want the implementation of this retry logic to get into our
publication workflow, so I stashed that into this command.

Maybe it will be useful to someone else here.



 Comments   
Comment by Magnolia International [ 02/Jun/08 ]

Thanks - could you elaborate a little with a real-world usecase / example ?

Comment by John Mettraux [ 02/Jun/08 ]

My usecase is during activation. We had failures at activation for pages with too big attachments. I have fixed those source of errors (covered in a previous patch, using a temp file to determine beforehand the size of the POST body, we also made sure to perform GC before activation for some of our deployments).

So now, activation is always OK for me but "boiled cat fears cold water". My project manager really wants me to implement this retry pattern, so I wrapped it into a command, I could have implemented that directly in the activation process definition, but I wanted something more concise and as we have commons chain mecha in Magnolia, why not leverage it.

I posted on the ML this piece of code that is not really useful for me in the hope it could benefit someone else that has activation issues (network?) or whatever other issue (after all, it can enable retry for any magnolia command).

If you guys don't feel the need for it, please reject this issue, no problem. At least the code is accessible for Magnolians via the mailing list.

Have a nice day,

John

Comment by Magnolia International [ 02/Jun/08 ]

Yep - I just don't really see how retrying will fix a failing activation, which is why I asked - but it's good to have this as a showcase/sample of what can be done - maybe we should put this up on the wiki - Philipp, any opinion on this ?

Comment by Jan Haderka [ 05/Jun/08 ]

Actually, Greg I disagree with you. It might happen that one of multiple public site will be intermittently out (restart, network problem, etc) during activation and having automatic retry makes whole activation process more robust. Since we aim for robustness in 3.6 I would suggest to deliver this with 3.6 version.

Comment by Magnolia International [ 11/Jul/08 ]

Will add this to a (still to be created) "contributions" project.

Comment by Michael Mühlebach [ 04/Nov/15 ]

Given the thousands of other issues we have open that are more highly requested, we won't be able to address this issue in the foreseeable future. Instead we will focus on issues with a higher impact, and more votes.
Thanks for taking the time to raise this issue. As you are no doubt aware this issue has been on our backlog for some time now with very little movement.
I'm going to close this to set expectations so the issue doesn't stay open for years with few updates. If the issue is still relevant please feel free to reopen it or create a new issue.

Generated at Mon Feb 12 03:34:01 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.