Author Topic: Luup restart, deadlock  (Read 1273 times)

Offline mda

  • Sr. Member
  • ****
  • Posts: 464
  • Karma: +9/-0
Luup restart, deadlock
« on: February 03, 2015, 01:43:57 pm »
@amg0

iPhone Locator is working well for me (thank you !). I currently have it monitoring 1 iPhone and i normally keep it muted. Whenever i open a door to the house, I unmute it for 10 minutes so it can update presence with no noticeable drain on my battery. In order to make sure i don't miss an entry/exit i have triggers setup for a scene that does the unmute including door open/close, lock/unlock, alarm armed/disarmed, etc. -- some of which i am sure occur within moments of each other at times.

Yesterday i had a luup restart and it looks like a deadlock with IL when likely > 1 of these triggered nearly at the same time.

Have you seen anything like this where a deadlock happens if IL is unmuted by a scene multiple times almost at once?

I can add logic to my scene to make sure it does not unmute if it just unmuted (if that is indeed causing the problem) but i wanted to flag this for you in case there is something going on underneath that is worth checking out. In particular in case this could be impacting others or if it might get worse one i add the other two iPhone accounts i need to add.

(Disclaimer: I am no Lua expert so my read of my logs could be entirely wrong and the deadlock might be related to something else entirely -- and therefore i would be sorry for bothering you ;)

I can PM you the log if it is helpful? I have also turned on debugging and verbose logging since the luup restart and will be able to send another better log if it happens again. Thanks.

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3027
  • Karma: +204/-8
Re: Luup restart, deadlock
« Reply #1 on: February 04, 2015, 04:21:34 pm »
@amg0

iPhone Locator is working well for me (thank you !). I currently have it monitoring 1 iPhone and i normally keep it muted. Whenever i open a door to the house, I unmute it for 10 minutes so it can update presence with no noticeable drain on my battery. In order to make sure i don't miss an entry/exit i have triggers setup for a scene that does the unmute including door open/close, lock/unlock, alarm armed/disarmed, etc. -- some of which i am sure occur within moments of each other at times.

Yesterday i had a luup restart and it looks like a deadlock with IL when likely > 1 of these triggered nearly at the same time.

Have you seen anything like this where a deadlock happens if IL is unmuted by a scene multiple times almost at once?

I can add logic to my scene to make sure it does not unmute if it just unmuted (if that is indeed causing the problem) but i wanted to flag this for you in case there is something going on underneath that is worth checking out. In particular in case this could be impacting others or if it might get worse one i add the other two iPhone accounts i need to add.

(Disclaimer: I am no Lua expert so my read of my logs could be entirely wrong and the deadlock might be related to something else entirely -- and therefore i would be sorry for bothering you ;)

I can PM you the log if it is helpful? I have also turned on debugging and verbose logging since the luup restart and will be able to send another better log if it happens again. Thanks.
Yes please send le the logs, this sounds interesting. You say it happens when several actions UnMute are happening together or close? I need to check but maybe it overloads vera, could be that I am not using Job properly and use Run instead. I think vera has a watch dog preventing RUN to take too much time while JOB does work asynchronous. It is just an idea I need to check ! tHx

Offline mda

  • Sr. Member
  • ****
  • Posts: 464
  • Karma: +9/-0
Re: Luup restart, deadlock
« Reply #2 on: February 04, 2015, 06:38:24 pm »
Thanks. I am away from my vera traveling so I should be able to get the logs to you Friday (sorry for the delay).

Offline amg0

  • Moderator
  • Master Member
  • *****
  • Posts: 3027
  • Karma: +204/-8
Re: Luup restart, deadlock
« Reply #3 on: February 05, 2015, 02:02:53 am »
Thanks. I am away from my vera traveling so I should be able to get the logs to you Friday (sorry for the delay).

ok here what I propose. when you can you capture the logs based on your current version. then you can also try this version ( attached ) where I have tried 2 things

- use <job> instead of <run> in the I_xxx file so that the SetMute() method is managed asynchronously
- in the SetMute() method, when the user unmutes, I was resuming the refresh engine of the IphoneLocator. Now, the same but I do it in using a timer so that the refresh starts in a seperate thread

if this works then we will know it was a a watchdog/action too long kind of issue.



Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 10091
  • Karma: +763/-142
Re: Luup restart, deadlock
« Reply #4 on: February 05, 2015, 09:39:56 am »
You should NEVER make a web request in a RUN action.