The "replace my script with one that does nothing, and then after things have settled down again, put it back the way it was before" hack is so useful, that it deserves to be enshrined as a function in the library with a name of its own. Is there some way that behavior could be codified meaningfully?
For example: xdmp:interrupt-module ($module-name) that prevent that module from being started until some condition is met (the task server is cleared? the task server has nothing queued with that name?) -Mike On 10/11/2011 12:19 PM, Geert Josten wrote: > Hi, > > I think what Jakob has in mind is checking some queue state as soon as a task > from the queue gets initiated. At that point the task that is being initiated > from the queue could decide to continue or cancel. Rather similar to > replacing the module with this 'no-op' suggestion by Damon.. > > But I thought someone on this list mentioned pondering about a separate > registration of tasks, and firing them one by one, based on priority etc. > Most of it should be feasible with one itself reactivating thread, that > spawns others, or perhaps using a cron.. > > Kind regards, > Geert > > -----Oorspronkelijk bericht----- > Van: [email protected] > [mailto:[email protected]] Namens Danny Sokolsky > Verzonden: dinsdag 11 oktober 2011 17:48 > Aan: General MarkLogic Developer Discussion > Onderwerp: Re: [MarkLogic Dev General] how to purge the task server queue? > > Hi Jakob, > > request-cancel would not work to clear the queue because the requests have > not yet started and therefore do not have an ID. You need to restart the node > that has the task server to clear the queue (or do something clever like > Damon suggested to make it clear Real Fast). > > There are some RFEs around providing more control of the task queue, and I > put your comments there. > > Also remember, if you are using CPF and you "clear the queue" by restarting, > CPF keeps a persistent state and remembers where you where, continueing > processing after the restart, so careful of the whack-a-mole issue. > > -Danny > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Jakob Fix > Sent: Tuesday, October 11, 2011 7:53 AM > To: General MarkLogic Developer Discussion > Subject: Re: [MarkLogic Dev General] how to purge the task server queue? > > Thanks Damon, > > we restarted the server. When you say "replace the invoked module with > a no-op module" this will not remove tasks currently in the queue, > correct? > > On a related note, could one write some code around > xdmp:request-cancel() to purge the queue? > In any case, I think it would be a useful addition to the api to be > able to better control the task server. > > Many thanks for your answer, > Jakob. > > > > On Tue, Oct 11, 2011 at 15:35, Damon Feldman > <[email protected]> wrote: > >> Jakob, >> >> Yes, restarting the server will clear the task queue. Also, you can replace >> the invoked module with a no-op module (xdmp:log("skipping queued task") or >> similar) if no other code is calling it. The queue will then "drain" quickly. >> >> I don't believe there is a programmatic way to remove queued tasks. >> >> Yours, >> Damon >> >> -----Original Message----- >> From: [email protected] >> [mailto:[email protected]] On Behalf Of Jakob Fix >> Sent: Tuesday, October 11, 2011 8:55 AM >> To: General Mark Logic Developer Discussion >> Subject: [MarkLogic Dev General] how to purge the task server queue? >> >> Hi, we have a long waiting list on our task server and would like to >> remove them programmatically. It doesn't look like there is such an >> option in the admin: api, or is there? Also, would restarting the >> server remove the waiting tasks from the queue? >> >> thanks in advance, >> Jakob. >> _______________________________________________ >> General mailing list >> [email protected] >> http://developer.marklogic.com/mailman/listinfo/general >> _______________________________________________ >> General mailing list >> [email protected] >> http://developer.marklogic.com/mailman/listinfo/general >> >> > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
