This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: multiprocessing.Event.wait(n) doesn't time out properly
Type: behavior Stage: resolved
Components: Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: mokrates, neologix
Priority: normal Keywords:

Created on 2011-07-11 23:06 by mokrates, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg140165 - (view) Author: (mokrates) Date: 2011-07-11 23:06
Following is my problem:
I have two processes, connected via multiprocessing.Event
The one waits for the other with .wait(300). After 300 seconds it should look if there's work, even if it has not been awoken by the other process.
So. This runs on my Laptop, and when I fold it shut, sending it to suspend, and open it again, lets say, 10 minutes later (which are 600 seconds), then the .wait()-timeout has already gone. I would assume, cause it's a /timeout/ that it should then fire ASAP, but it fires never. The worker process is just frozen and has to be awoken by .set()ing the Event.

I workarounded it by creating another thread, which uses time.sleep(300) instead of multiprocessing.Event.wait(300) to wait 300 seconds and some glue to put it all together.

some stats:
me@mybox:~$ python2.7
Python 2.7.1+ (default, Apr 20 2011, 22:33:39) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
me@mybox:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux testing (wheezy)
Release:	testing
Codename:	wheezy
msg140174 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2011-07-12 07:00
Are you using a 2.6.38 kernel?
There was a regression in early 2.6.38 kernels that caused FUTEX_WAIT with a timeout to never return after a suspend-resume, see:
https://lkml.org/lkml/2011/4/13/23

It's been fixed by this commit:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0cd9c6494ee5c19aef085152bc37f3a4e774a9e1

Could you try with a more recent kernel (it should be fixed in 2.6.38.4)?
msg140178 - (view) Author: (mokrates) Date: 2011-07-12 08:46
> Are you using a 2.6.38 kernel?

Yes

> There was a regression in early 2.6.38 kernels that caused FUTEX_WAIT
> with a timeout to never return after a suspend-resume, see:
> https://lkml.org/lkml/2011/4/13/23

Ah, thank you, that explains why gajim has problems too...

>  Could you try with a more recent kernel (it should be fixed in
> 2.6.38.4)?

I will, when it comes with my ubuntu... Thank you very much.

mo
msg140185 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2011-07-12 13:38
>> Are you using a 2.6.38 kernel?

> Yes

Alright, closing as invalid then.
History
Date User Action Args
2022-04-11 14:57:19adminsetgithub: 56748
2011-07-12 13:38:20neologixsetstatus: open -> closed
resolution: not a bug
messages: + msg140185

stage: resolved
2011-07-12 08:46:48mokratessetmessages: + msg140178
2011-07-12 07:00:02neologixsetnosy: + neologix
messages: + msg140174
2011-07-11 23:06:22mokratescreate