You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@allura.apache.org by Huzaifa Faruqui <hu...@gmail.com> on 2017/04/03 14:12:31 UTC

Trouble while testing Bulk edit locally

When I bulk edit tickets and save changes I get 'Update Scheduled' flash on
the screen. However, changes do not take place. I see that that the
tasks.bulk_edit() method has been decorated & a new method 'post' has been
added to it which adds some sort of delay in ticket update. But in my case
there is infinite delay. I have also ensured that mongod, solr, taskd are
running in the background. How to resolve this behaviour?

Re: Trouble while testing Bulk edit locally

Posted by Dave Brondsema <da...@brondsema.net>.
The post() is a bit magical.  It records the function call & parameters into
mongo as a "task".  Then the taskd process sees that there is a task ready to
run, and runs it.

So bulk_edit doesn't run in the main web process, it runs in the taskd process.
Therefore, if you make some code changes, you will need to restart the taskd
process.  You should be able to use ipdb with taskd, if you run `paster taskd
...` directly (don't use nohup or anything like that which runs in the background)

On 4/3/17 4:46 PM, Huzaifa Faruqui wrote:
> Solved that issue(I was doing something silly). However, I am still not
> able to understand how post() method is working. Even though
> tasks.bulk_edit.post(**post_data) is doing what it is supposed to do, but
> changing anything in bulk_edit() or adding any debug statements in it
> (simple print or ipdb) is not being reflected as if bulk_edit() is not
> being called.
> 
> On Mon, Apr 3, 2017 at 8:54 PM, Dave Brondsema <da...@brondsema.net> wrote:
> 
>> On 4/3/17 10:12 AM, Huzaifa Faruqui wrote:
>>> When I bulk edit tickets and save changes I get 'Update Scheduled' flash
>> on
>>> the screen. However, changes do not take place. I see that that the
>>> tasks.bulk_edit() method has been decorated & a new method 'post' has
>> been
>>> added to it which adds some sort of delay in ticket update. But in my
>> case
>>> there is infinite delay. I have also ensured that mongod, solr, taskd are
>>> running in the background. How to resolve this behaviour?
>>>
>>
>> All functions that have the @task decorator get a .post() method added to
>> them,
>> which has them run in the background on the taskd process.  A bit more info
>> here: https://forge-allura.apache.org/docs/platform/message_bus.html
>>
>> The bulk edit for tickets uses this since it can take several seconds or
>> more to
>> run, when you are updating lots of tickets.
>>
>> So having taskd running is necessary of course.  What does the taskd log
>> output
>> say?  It should have at least one line about running the bulk edit task,
>> maybe
>> more.  You can also go to the /nf/admin/task_manager URL to find the task
>> and
>> see its status & output (may need to use the ">" arrow to page back
>> further in
>> time; or use ?minutes=100 etc in the URL, to find the task if it was a
>> while ago)
>>
>>
>> --
>> Dave Brondsema : dave@brondsema.net
>> http://www.brondsema.net : personal
>> http://www.splike.com : programming
>>               <><
>>
> 



-- 
Dave Brondsema : dave@brondsema.net
http://www.brondsema.net : personal
http://www.splike.com : programming
              <><

Re: Trouble while testing Bulk edit locally

Posted by Huzaifa Faruqui <hu...@gmail.com>.
Solved that issue(I was doing something silly). However, I am still not
able to understand how post() method is working. Even though
tasks.bulk_edit.post(**post_data) is doing what it is supposed to do, but
changing anything in bulk_edit() or adding any debug statements in it
(simple print or ipdb) is not being reflected as if bulk_edit() is not
being called.

On Mon, Apr 3, 2017 at 8:54 PM, Dave Brondsema <da...@brondsema.net> wrote:

> On 4/3/17 10:12 AM, Huzaifa Faruqui wrote:
> > When I bulk edit tickets and save changes I get 'Update Scheduled' flash
> on
> > the screen. However, changes do not take place. I see that that the
> > tasks.bulk_edit() method has been decorated & a new method 'post' has
> been
> > added to it which adds some sort of delay in ticket update. But in my
> case
> > there is infinite delay. I have also ensured that mongod, solr, taskd are
> > running in the background. How to resolve this behaviour?
> >
>
> All functions that have the @task decorator get a .post() method added to
> them,
> which has them run in the background on the taskd process.  A bit more info
> here: https://forge-allura.apache.org/docs/platform/message_bus.html
>
> The bulk edit for tickets uses this since it can take several seconds or
> more to
> run, when you are updating lots of tickets.
>
> So having taskd running is necessary of course.  What does the taskd log
> output
> say?  It should have at least one line about running the bulk edit task,
> maybe
> more.  You can also go to the /nf/admin/task_manager URL to find the task
> and
> see its status & output (may need to use the ">" arrow to page back
> further in
> time; or use ?minutes=100 etc in the URL, to find the task if it was a
> while ago)
>
>
> --
> Dave Brondsema : dave@brondsema.net
> http://www.brondsema.net : personal
> http://www.splike.com : programming
>               <><
>

Re: Trouble while testing Bulk edit locally

Posted by Dave Brondsema <da...@brondsema.net>.
On 4/3/17 10:12 AM, Huzaifa Faruqui wrote:
> When I bulk edit tickets and save changes I get 'Update Scheduled' flash on
> the screen. However, changes do not take place. I see that that the
> tasks.bulk_edit() method has been decorated & a new method 'post' has been
> added to it which adds some sort of delay in ticket update. But in my case
> there is infinite delay. I have also ensured that mongod, solr, taskd are
> running in the background. How to resolve this behaviour?
> 

All functions that have the @task decorator get a .post() method added to them,
which has them run in the background on the taskd process.  A bit more info
here: https://forge-allura.apache.org/docs/platform/message_bus.html

The bulk edit for tickets uses this since it can take several seconds or more to
run, when you are updating lots of tickets.

So having taskd running is necessary of course.  What does the taskd log output
say?  It should have at least one line about running the bulk edit task, maybe
more.  You can also go to the /nf/admin/task_manager URL to find the task and
see its status & output (may need to use the ">" arrow to page back further in
time; or use ?minutes=100 etc in the URL, to find the task if it was a while ago)


-- 
Dave Brondsema : dave@brondsema.net
http://www.brondsema.net : personal
http://www.splike.com : programming
              <><