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

tmouthandler: should "oneshot" timer remove itself from reactor? #84

Closed
grondo opened this issue Oct 23, 2014 · 1 comment · Fixed by #86
Closed

tmouthandler: should "oneshot" timer remove itself from reactor? #84

grondo opened this issue Oct 23, 2014 · 1 comment · Fixed by #86

Comments

@grondo
Copy link
Contributor

grondo commented Oct 23, 2014

One might expect that a reactor loaded with one single shot timer should exit normally after
the timer is fired, for example, with the following lua code (not yet committed to a repo yet, sorry)

#!/usr/bin/lua
local f,err = require 'flux'.new()
if not f then error (err) end

local count = 0
local to, err = f:timer {
    timeout = 250,
    oneshot = true,
    handler = function (f, to)
            count = count + 1
        print (count)
    end
}
local r = f:reactor()
print ("exited from reactor with r="..r)

One would expect output like:

1
exited reactor with r=0

However, observed behavior is that the reactor hangs indefinitely after timer fires and requiresa ^C:

(flux-236991-0) grondo@hype356:~/git/flux-core.git/t/lua$ lua t.lua 
1
^Clua: t.lua:14: interrupted!
stack traceback:
        [C]: in function 'reactor'
        t.lua:14: in main chunk
        [C]: ?

Adding to:remove() to the timeout handler does rectify the issue, but it seems like it should be unecessary.

@garlick
Copy link
Member

garlick commented Oct 23, 2014

Agreed it should remove itself. Will fix.

garlick added a commit to garlick/flux-core that referenced this issue Oct 23, 2014
grondo added a commit that referenced this issue Oct 23, 2014
reactor: oneshot timer should remove self from reactor.
Fixes #84
grondo pushed a commit to grondo/flux-core that referenced this issue Oct 31, 2014
grondo pushed a commit to grondo/flux-core that referenced this issue Dec 12, 2019
Now that all users are using libsodium's base64 implementation,
drop the one from munge.

Fixes flux-framework#84
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants