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

Inactivity timeout not cleared #17

Closed
fdmanana opened this issue Nov 2, 2010 · 8 comments
Closed

Inactivity timeout not cleared #17

fdmanana opened this issue Nov 2, 2010 · 8 comments

Comments

@fdmanana
Copy link
Contributor

fdmanana commented Nov 2, 2010

Hi Chandru.

I found out that, with ibrowse 2.0.x, if I use a worker for several request and the first request had an activity timeout X specified in the options, the timer is never cleared, causing a subsequent request (after X milliseconds) to fail.

Patch at:

http://github.com/fdmanana/ibrowse/commit/072d4f865fb77609e6cd75639a36264fbfb19933

Cheers

@cmullaparthi
Copy link
Owner

hi Filipe,

My version of ibrowse which is in the works has set_inac_timer implemented as follows:

set_inac_timer(State) ->
    cancel_timer(State#state.inactivity_timer_ref),
    set_inac_timer(State#state{inactivity_timer_ref = undefined},
                   get_inac_timeout(State)).

set_inac_timer(State, Timeout) when is_integer(Timeout) ->
    Ref = erlang:send_after(Timeout, self(), timeout),
    State#state{inactivity_timer_ref = Ref};
set_inac_timer(State, _) ->
    State.

What do you think?

@fdmanana
Copy link
Contributor Author

fdmanana commented Nov 3, 2010

Hi Chandru,

Seems fine to me.
When do you plan to add it to the official, stable release?

If it takes long, I'll add mine to CouchDB, since we plan to release 1.0.2 soon.

cheers

@cmullaparthi
Copy link
Owner

I'll get it done asap. Shouldn't take more than a day or two.

@fdmanana
Copy link
Contributor Author

fdmanana commented Nov 3, 2010

Great! :)
Thanks

@gdamjan
Copy link

gdamjan commented Nov 8, 2010

Is this connected to this problem I've encountered?
I use the async interface to connect to the twitter stream api, I've set {inactivity_timeout, 120000}. This is what happens:

| now() tupple | Some internal data | Data received
{1289,188418,975924} <<>> <<"\r\n">>
{1289,188448,980026} <<>> <<"\r\n">>
{1289,188478,984936} <<>> <<"\r\n">>
{1289,188508,990110} <<>> <<"\r\n">>
{error,req_timedout}

Even though I receive keepalive data from twitter, after 2minutes ibrowse times-out.

@cmullaparthi
Copy link
Owner

Yes, sounds like it is related. A new release is imminent with a fix.

@fdmanana
Copy link
Contributor Author

fdmanana commented Nov 9, 2010

Yes, that's definitely the same error I was having.

@cmullaparthi
Copy link
Owner

Fixed in ibrowse-2.1.0

This issue was closed.
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

No branches or pull requests

3 participants