Re: [web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-04-24 Thread Osman Masood
Nope...as proven earlier, this is a web2py timing issue. It's been occurring randomly in production for some time now. I have a try/except surrounding it, but the sucky part is that since the transaction fails, you lose all the commits in the whole request. On Friday, February 27, 2015 at

Re: [web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-27 Thread Michele Comitini
Try too see if in production there is a transaction that stays open for a long time. It could be a console left open somewhere? 2015-02-27 8:42 GMT+01:00 Osman Masood oamas...@gmail.com: Right. The purpose of using the console was to simulate what actually happens in production. On Thu, Feb

Re: [web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Osman Masood
Right. The purpose of using the console was to simulate what actually happens in production. On Thu, Feb 26, 2015 at 11:39 PM, Niphlod niph...@gmail.com wrote: you know that on console, after queue_task() you need to commit(), right ? If you leave the transaction hanging, no wonder that you're

[web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Niphlod
you know that on console, after queue_task() you need to commit(), right ? If you leave the transaction hanging, no wonder that you're observing deadlocks! On Friday, February 27, 2015 at 3:38:19 AM UTC+1, Osman Masood wrote: I was actually able to easily reproduce this. Just open up 2 web2py

[web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Niphlod
it seems to me that there is database contention although the exception **should** be trapped (i.e. try to set the status to PICK, if not, well it's not a fatal error), there's something wrong with your setup or your database is too much underpowered to do what you're asking. How

[web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Osman Masood
Thanks for the quick response! I'm using Amazon RDS (just basically MySQL), on a pretty beefy instance (db.m3.large), 1000 IOPS. Would be pretty surprised if that were the problem. Running 5 scheduler workers with the default heartbeat (3s). On Thursday, February 26, 2015 at 3:35:41 PM UTC-8,

[web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Osman Masood
I was actually able to easily reproduce this. Just open up 2 web2py consoles (which connect to the same DB), and do: scheduler.queue_task('myfunc', pvars=dict(), immediate=True) The first one will succeed, and the second one will hang there for some time, and then give the deadlock exception