Background tasks and deadlines

Mike Gambier madgambler at hotmail.com
Tue Feb 7 05:47:28 EST 2012


Mike,
 
I think you're referring to the setting of field SWP_ADMIN-MAX_NODES which is set to a default of 10,000 and can be adjusted in SPRO?:
 

 SAP NetWeaver=>Application Server=>SAP Business Workflow=>Basic Settings (Workflow System)=>Maintain Administration Data for Workflow Runtime System
 
(aka Transation SWPA)
 
This isn't a hard cap and can be adjusted if clients choose, although why they would is beyond me.
 
Prior to ECC 6 I think was defaulted to '9999' if memory serves, but it appears these days you can be daft and put bigger numbers (INT4:Length 10).
 
I've seen a few infinite loops like this before and the telltale sign is the node number buried in the SWWWIHEAD-WI_CREATOR field skyrocketing if you dig down (depending on the WF definition and whether the steps end up creationg entries there).
 
With regards to the original problem (which I admit I've only skimmed), have you considered switching to a qRFC approach and using SMQR to deregister the specific Queue to catch the RFC manually?
 

http://help.sap.com/saphelp_nw04/helpdata/en/8f/53b67ad30be445b0ccc968d69bc6ff/content.htm
 
Mike GT
 

> Date: Tue, 7 Feb 2012 10:09:23 +0000
> Subject: RE: Background tasks and deadlines
> From: wug at workflowconnections.com
> To: sap-wug at mit.edu
> 
> Hi Rick,
> 
> Florin is absolutely correct that this should not work that way. As I
> suggested, this would probably be better off in an asynch task or have
> approriate controls in the code.
> 
> Regarding the 30 minutes, Margaret already pointed you to the
> Miscellaneous tab. It used to be hardcoded somewhere (no time to search
> whether it still exists), but has since been parameterised. HOWEVER, the
> timeout is only meant for tasks that have died. I would have been very
> surprised if it had been able to kill a running program.
> 
> The config you mention is to abort a _workflow_ in an endless loop after
> 10,000 steps, which is not the case since you're stuck on a single task.
> It's hiding in TX SWPA if you want to have a look anyway.
> 
> Addressing this in WF is just a sticky plaster for badly behaving code.
> 
> Regards,
> Mike
> 
> 
> On Mon, February 6, 2012 2:13 pm, Sample, Rick wrote:
> > First, this is low priority issue. I found something I did not think was
> > allowed and testing.
> >
> > Org issue, in prod with very large PO lines a FM call in a background task
> > gets stuck. Working on the issue, but I tried to just abort the call and
> > move to next user until I have time to work on it. Nothing I tried is
> > working.
> >
> > Test:
> > I created a very simple test WF that I put into an endless loop to attempt
> > a quick fix using an End Deadline. Doing this, I found when it gets stuck
> > in loop, it gets "STUCK" in loop. Never errors, never ends, etc. I have to
> > logically delete the task and kill the process from SM50. I have been away
> > from SAP for 6+ months, but as I recall, the system should never allow
> > these run away loops. I am reviewing my notes for config to abort on these
> > endless loops. I know there config, just don't recall where. I believe
> > there is a BASIS level and a WF System level config to abort after x times
> > or time.
> >
> > Thanks,
> > Rick
> >
> >
> >
> > -----Original Message-----
> > From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
> > Of Kjetil Kilhavn
> > Sent: Monday, February 06, 2012 2:21 AM
> > To: SAP Workflow Users' Group
> > Subject: Re: Background tasks and deadlines
> >
> > Fredag 3. februar 2012 10.45.31 skrev Sample, Rick:
> >> Hi Margaret,
> >>
> >> Never used it before, but I just tried it. Nope! Does not stop the
> >> task or the BOR-Method process. When I Logically Delete the WF task,
> >> the program still continues to run, until I kill it in SM50.
> >>
> >> I am looking for the config for time outs. I believe there is an SWU3
> >> setting. Forces long running "Oops loops" into error if they take
> >> longer than 'X' time. As Mike stated, supposed to be 30 mins default.
> >> (as I recall anyway). I have been away from SAP for 6+ months, so
> >> little rusty and doing the hunt & peck method of finding this setting.
> >>
> >> Thanks - and if you know where these settings are to set WF tasks or
> >> 'stuck in loop' processes to error, please forward. Rick
> >
> > I would try to fix the ABAP instead (unless I have misunderstood and the
> > looping is in the workflow definition).
> > I guess this is just stating the obvious, but if the background step runs
> > into an endless loop you need to add conditions to prevent that. If the
> > database selection takes too long there's a need for either a slight
> > rewrite to use better indexes or the creation of a new index. Perhaps
> > you'll find that the endless loop is in SAP's code and can report an error
> > - in which case your problem will be solved (eventually) and the rest of
> > us won't have to suffer the same problem.
> > You wouldn't happen to have fallen into the "FOR ALL ENTRIES" on an empty
> > table trap? I've been there, and I'm sure most of the readers here have
> > too.
> >
> >> -----Original Message-----
> >> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On
> >> Behalf Of Hilsbos, Margaret A Sent: Friday, February 03, 2012 10:19 AM
> >> To: SAP Workflow Users' Group
> >> Subject: RE: Background tasks and deadlines
> >>
> >> Rick,
> >>
> >> I don't know if this was mentioned yet ... in the workflow step
> >> definition, scroll far to the right, on the Miscellaneous tab, there
> >> is a setting labeled "Time from Creation of Work Item Until Timeout".
> >> The help for this field says, "Time interval between the creation of
> >> the background work item and the occurrence of the timeout."
> >>
> >> Have you tried this?
> >>
> >> Margaret Hilsbos
> >> Day & Zimmermann
> >>
> >>
> >>
> >> -----Original Message-----
> >> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On
> >> Behalf Of Sample, Rick Sent: Friday, February 03, 2012 10:18 AM
> >> To: SAP Workflow Users' Group
> >> Subject: RE: Background tasks and deadlines
> >>
> >> Thanks for assistance all.
> >>
> >> No success. And one more question.
> >>
> >> Mike, on your point on the 30 minute error rule. That is obviously not
> >> working here. These looped task will run for days if I let them. So
> >> would you be so kind as to remind me where that setting is located? I
> >> recall a setting, but can't recall what / where.
> >>
> >> First, until I can figure out why code that has been working correctly
> >> for 6 yrs is now 'sometimes' getting stuck in loop, I would like to
> >> stop the bleeding.
> >>
> >> Tests:
> >> I created a simple test WF with BG task and simple DO forever loop.
> >> I tried everything that I can think of (and suggestions from list) to
> >> stop this task and running process in SM50. Parallel fork suggestion,
> >> continues the flow, but does not stop the said BG Looped task. Async
> >> with term event, nada. Deadline, nope!
> >>
> >>
> >> -----Original Message-----
> >> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On
> >> Behalf Of Mike Pokraka Sent: Friday, February 03, 2012 7:07 AM
> >> To: SAP Workflow Users' Group
> >> Subject: Re: Background tasks and deadlines
> >>
> >> Persn'ly I'd consider the wrong approach.
> >>
> >> Deadlines aren't meant for this level of control. The timing
> >> resolution is a
> >> 5 minutes accuracy at best, and background tasks error after 30
> >> minutes by default (at least last time I looked). If a background task
> >> takes that long it should probably be asynch anyway.
> >>
> >> Best off doing this in code - add a timer to whatever the task method
> >> does
> >> - e.g. in a loop. Use SELECT ... PACKAGE SIZE nnn to break up a
> >> long-running query - it would even improve DB performance if it means
> >> you can stop a query gracefully whever it takes too long.
> >>
> >> Otherwise I suppose one could create a 'Meta method' that submits a
> >> task and monitors it in a WAIT UP TO... loop. Not pretty but an option.
> >>
> >> Regards,
> >> Mike
> >>
> >> On Thu, February 2, 2012 5:52 pm, Sample, Rick wrote:
> >> > Hey Wug'ers
> >> >
> >> > I have someone trying to use a deadline on a background task.
> >> > Just complete the task if it takes too long.
> >> >
> >> > Been a while, so don't recall if this is possible.
> >> > I thought of using CALL FUNCTION 'C160_HOLD_FOR_DEBUG'.
> >> > but that won't work in WF-BATCH. (Unless someone knows how to take
> >> > over a WF-BATCH via SM50?)
> >> >
> >> > Any way to set the task to complete in background task would be
> >> > appreciated.
> >> >
> >> > Rick
> >> > _______________________________________________
> >> > SAP-WUG mailing list
> >> > SAP-WUG at mit.edu
> >> > http://mailman.mit.edu/mailman/listinfo/sap-wug
> >>
> >> _______________________________________________
> >> SAP-WUG mailing list
> >> SAP-WUG at mit.edu
> >> http://mailman.mit.edu/mailman/listinfo/sap-wug
> >>
> >> _______________________________________________
> >> SAP-WUG mailing list
> >> SAP-WUG at mit.edu
> >> http://mailman.mit.edu/mailman/listinfo/sap-wug
> >>
> >> _______________________________________________
> >> SAP-WUG mailing list
> >> SAP-WUG at mit.edu
> >> http://mailman.mit.edu/mailman/listinfo/sap-wug
> >>
> >> _______________________________________________
> >> SAP-WUG mailing list
> >> SAP-WUG at mit.edu
> >> http://mailman.mit.edu/mailman/listinfo/sap-wug
> > --
> > Kjetil Kilhavn (+47 40220607) - Blue Consulting AS (http://www.bluec.no)
> > _______________________________________________
> > SAP-WUG mailing list
> > SAP-WUG at mit.edu
> > http://mailman.mit.edu/mailman/listinfo/sap-wug
> >
> > _______________________________________________
> > SAP-WUG mailing list
> > SAP-WUG at mit.edu
> > http://mailman.mit.edu/mailman/listinfo/sap-wug
> >
> 
> 
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20120207/c9d006e5/attachment.htm


More information about the SAP-WUG mailing list