Update, I have added several comments to this controller to see, where it
gets block, the funny thing is that nothing really happens in those weird
cases meaning that the controller is not executed at all, until I kill some
spawned processes run by subprocess module, after that it appears, that all
the request that came in the time period when controller was malfunctioning
are handled at once (all comments appeared repeatedly). Maybe some problem
with process spawning?
Thanks, Jan
Dne pondělí, 4. června 2012 9:20:39 UTC+2 Jan Rozhon napsal(a):
>
> Hi group, I have encountered a problem when I try to call a controller
> which should return a JSON array of values from database. However in abou 1
> of 5 cases this call stucks in "loading" phase (chrome animation in tab)
> and no response is received. Data is in database, every other controller is
> working fine, cpu utilization is pretty low so is the memory and there are
> only about 10000 rows in DB. Could you please give me some hints?
>
> Thanks, Jan
>
> PS. The controller looks like this:
>
> def dberrorsselect():
> """Performs sql query to get the errors in the form of list of dicts
> such as {field_name:value}. This is then transformed to json dict for
> transfer."""
> if session.tb_id:
>
> max_id=tb(tb.errors.test_id==session.tb_id).select(tb.errors.id.max()).first()[tb.errors.id.max()]
> if max_id != None:
> selector_id=int(max_id)-5
> else:
> selector_id=0
> rows=tb((tb.errors.test_id==session.tb_id)&(tb.errors.id >
> selector_id)).select(tb.errors.ts, tb.errors.msg_short, tb.errors.msg_long)
> output=rows
> else:
> output=[]
> return dict(output=output)
>
>
>