Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kqueue timers don't work properly #51726

Closed
hasan mannequin opened this issue Dec 11, 2009 · 3 comments
Closed

kqueue timers don't work properly #51726

hasan mannequin opened this issue Dec 11, 2009 · 3 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@hasan
Copy link
Mannequin

hasan mannequin commented Dec 11, 2009

BPO 7477

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2009-12-11.21:53:52.635>
created_at = <Date 2009-12-11.12:08:49.935>
labels = ['type-bug', 'library']
title = "kqueue timers don't work properly"
updated_at = <Date 2009-12-11.21:53:52.634>
user = 'https://bugs.python.org/hasan'

bugs.python.org fields:

activity = <Date 2009-12-11.21:53:52.634>
actor = 'hasan'
assignee = 'none'
closed = True
closed_date = <Date 2009-12-11.21:53:52.635>
closer = 'hasan'
components = ['Library (Lib)']
creation = <Date 2009-12-11.12:08:49.935>
creator = 'hasan'
dependencies = []
files = []
hgrepos = []
issue_num = 7477
keywords = []
message_count = 3.0
messages = ['96247', '96250', '96274']
nosy_count = 1.0
nosy_names = ['hasan']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue7477'
versions = ['Python 2.6']

@hasan
Copy link
Mannequin Author

hasan mannequin commented Dec 11, 2009

kqueue timers are not working at all on Mac OSX 10.6.1 (probably not
working on other BSDs as well but haven't tested it).

Here's a simply repro:

from select import *
kq = kqueue()
e = kevent(10000, flags=KQ_EV_ENABLE|KQ_EV_ONESHOT, 
filter=KQ_FILTER_TIMER)
e
<select.kevent ident=10000 filter=-7 flags=0x14 fflags=0x0 data=0x0 
udata=0x0>
new_e = f.control([e], 1, 0)

This should block 10s before it returns control with new_e having a timer
event returned. However, it isn't the case.
control returns immediately returning a busted event:
[<select.kevent ident=10000 filter=-7 flags=0x4000 fflags=0x0 data=0x2
udata=0x0>]

Am I missing something?

@hasan hasan mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Dec 11, 2009
@hasan
Copy link
Mannequin Author

hasan mannequin commented Dec 11, 2009

Typo in the repro.

The statement:
new_e = f.control
should be:
new_e = kq.control

@hasan
Copy link
Mannequin Author

hasan mannequin commented Dec 11, 2009

Closing it. My mistake. I was passing incorrect arguments. KQ_EV_ONESHOT
requires KQ_EV_ADD as well, and timer data goes into data.

@hasan hasan mannequin closed this as completed Dec 11, 2009
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

0 participants