You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "kuotai (JIRA)" <ji...@apache.org> on 2012/07/13 09:21:33 UTC

[jira] [Created] (TS-1348) replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout

kuotai created TS-1348:
--------------------------

             Summary: replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout
                 Key: TS-1348
                 URL: https://issues.apache.org/jira/browse/TS-1348
             Project: Traffic Server
          Issue Type: Improvement
          Components: Core, Network, Performance
    Affects Versions: 3.3.1
            Reporter: kuotai
            Assignee: kuotai


if calling set_active_timeout function in keepalive, every connection will create one event and schedule in event system. so if having more and more connection in keepalive state(more and more event in schedule system), system have to take more time to PriorityEventQueue::check_ready.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (TS-1348) replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout

Posted by "kuotai (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-1348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416813#comment-13416813 ] 

kuotai edited comment on TS-1348 at 7/18/12 2:27 AM:
-----------------------------------------------------

yeah, if use only set_inactivity_timeout in KA, we must call cancel_active_timeout(). The additional patch:

{code}
diff --git a/proxy/http/HttpClientSession.cc b/proxy/http/HttpClientSession.cc
index 17d6945..ae6652a 100644
--- a/proxy/http/HttpClientSession.cc
+++ b/proxy/http/HttpClientSession.cc
@@ -577,6 +577,7 @@ HttpClientSession::attach_server_session(HttpServerSession * ssession, bool tran
     if (transaction_done) {
       ssession->get_netvc()->
         set_inactivity_timeout(HRTIME_SECONDS(current_reader->t_state.txn_conf->keep_alive_no_activity_timeout_out));
+      ssession->get_netvc()->cancel_active_timeout();
     } else {
       // we are serving from the cache - this could take a while.
       ssession->get_netvc()->cancel_inactivity_timeout();
@@ -628,6 +629,7 @@ HttpClientSession::release(IOBufferReader * r)
     ka_vio = this->do_io_read(this, INT64_MAX, read_buffer);
     ink_assert(slave_ka_vio != ka_vio);
     client_vc->set_inactivity_timeout(HRTIME_SECONDS(ka_in));
+    client_vc->cancel_active_timeout();
   }
 }
{code}
                
      was (Author: kuotai):
    yeah, if use only set_inactivity_timeout in KA, we must call cancel_active_timeout(). The additional patch:

diff --git a/proxy/http/HttpClientSession.cc b/proxy/http/HttpClientSession.cc
index 17d6945..ae6652a 100644
--- a/proxy/http/HttpClientSession.cc
+++ b/proxy/http/HttpClientSession.cc
@@ -577,6 +577,7 @@ HttpClientSession::attach_server_session(HttpServerSession * ssession, bool tran
     if (transaction_done) {
       ssession->get_netvc()->
         set_inactivity_timeout(HRTIME_SECONDS(current_reader->t_state.txn_conf->keep_alive_no_activity_timeout_out));
+      ssession->get_netvc()->cancel_active_timeout();
     } else {
       // we are serving from the cache - this could take a while.
       ssession->get_netvc()->cancel_inactivity_timeout();
@@ -628,6 +629,7 @@ HttpClientSession::release(IOBufferReader * r)
     ka_vio = this->do_io_read(this, INT64_MAX, read_buffer);
     ink_assert(slave_ka_vio != ka_vio);
     client_vc->set_inactivity_timeout(HRTIME_SECONDS(ka_in));
+    client_vc->cancel_active_timeout();
   }
 }
 

                  
> replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout
> ---------------------------------------------------------------------------------------------
>
>                 Key: TS-1348
>                 URL: https://issues.apache.org/jira/browse/TS-1348
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Core, Network, Performance
>    Affects Versions: 3.2.0
>            Reporter: kuotai
>            Assignee: kuotai
>             Fix For: 3.3.0
>
>         Attachments: kpa_timeout.patch
>
>
> if calling set_active_timeout function in keepalive, every connection will create one event and schedule in event system. so if having more and more connection in keepalive state(more and more event in schedule system), system have to take more time to PriorityEventQueue::check_ready.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TS-1348) replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-1348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416378#comment-13416378 ] 

Leif Hedstrom commented on TS-1348:
-----------------------------------

I think I have an idea. Setting these active timeouts also cancels the old timeout, which could otherwise trigger while we are in KA. What we really need is to replace these two active timeouts with a call to simply cancel the old ones.
                
> replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout
> ---------------------------------------------------------------------------------------------
>
>                 Key: TS-1348
>                 URL: https://issues.apache.org/jira/browse/TS-1348
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Core, Network, Performance
>    Affects Versions: 3.2.0
>            Reporter: kuotai
>            Assignee: kuotai
>             Fix For: 3.3.0
>
>         Attachments: kpa_timeout.patch
>
>
> if calling set_active_timeout function in keepalive, every connection will create one event and schedule in event system. so if having more and more connection in keepalive state(more and more event in schedule system), system have to take more time to PriorityEventQueue::check_ready.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (TS-1348) replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout

Posted by "kuotai (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-1348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

kuotai updated TS-1348:
-----------------------

    Attachment: kpa_timeout.patch
    
> replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout
> ---------------------------------------------------------------------------------------------
>
>                 Key: TS-1348
>                 URL: https://issues.apache.org/jira/browse/TS-1348
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Core, Network, Performance
>    Affects Versions: 3.3.1
>            Reporter: kuotai
>            Assignee: kuotai
>         Attachments: kpa_timeout.patch
>
>
> if calling set_active_timeout function in keepalive, every connection will create one event and schedule in event system. so if having more and more connection in keepalive state(more and more event in schedule system), system have to take more time to PriorityEventQueue::check_ready.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TS-1348) replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout

Posted by "weijin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-1348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416819#comment-13416819 ] 

weijin commented on TS-1348:
----------------------------

yes, the active_timeout event should be canceled, to prevent calling httpSM (or it self) back.  Thanks Leif.
                
> replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout
> ---------------------------------------------------------------------------------------------
>
>                 Key: TS-1348
>                 URL: https://issues.apache.org/jira/browse/TS-1348
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Core, Network, Performance
>    Affects Versions: 3.2.0
>            Reporter: kuotai
>            Assignee: kuotai
>             Fix For: 3.3.0
>
>         Attachments: kpa_timeout.patch
>
>
> if calling set_active_timeout function in keepalive, every connection will create one event and schedule in event system. so if having more and more connection in keepalive state(more and more event in schedule system), system have to take more time to PriorityEventQueue::check_ready.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TS-1348) replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout

Posted by "weijin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-1348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13415070#comment-13415070 ] 

weijin commented on TS-1348:
----------------------------

It`s ok to me, but i am not quite sure about the outcome of the patch. I`ll commit it if there is no opposition.
                
> replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout
> ---------------------------------------------------------------------------------------------
>
>                 Key: TS-1348
>                 URL: https://issues.apache.org/jira/browse/TS-1348
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Core, Network, Performance
>    Affects Versions: 3.2.0
>            Reporter: kuotai
>            Assignee: kuotai
>             Fix For: 3.3.0
>
>         Attachments: kpa_timeout.patch
>
>
> if calling set_active_timeout function in keepalive, every connection will create one event and schedule in event system. so if having more and more connection in keepalive state(more and more event in schedule system), system have to take more time to PriorityEventQueue::check_ready.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (TS-1348) replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout

Posted by "Zhao Yongming (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-1348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zhao Yongming closed TS-1348.
-----------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 3.3.1)
                   3.3.0

already committed by Leif, in 5d6e40391dbc21dfa843a29dea602150fe8f4ed7
                
> replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout
> ---------------------------------------------------------------------------------------------
>
>                 Key: TS-1348
>                 URL: https://issues.apache.org/jira/browse/TS-1348
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Core, Network, Performance
>    Affects Versions: 3.2.0
>            Reporter: kuotai
>            Assignee: kuotai
>             Fix For: 3.3.0
>
>         Attachments: kpa_timeout.patch
>
>
> if calling set_active_timeout function in keepalive, every connection will create one event and schedule in event system. so if having more and more connection in keepalive state(more and more event in schedule system), system have to take more time to PriorityEventQueue::check_ready.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (TS-1348) replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-1348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416386#comment-13416386 ] 

Leif Hedstrom commented on TS-1348:
-----------------------------------

So, looking some more, are you positive removing the first activity timeout is correct? I'm thinking a patch more like
{code}
diff --git a/proxy/http/HttpClientSession.cc b/proxy/http/HttpClientSession.cc
index 188e785..bf361c0 100644
--- a/proxy/http/HttpClientSession.cc
+++ b/proxy/http/HttpClientSession.cc
@@ -155,7 +155,6 @@ HttpClientSession::new_transaction()
   DebugSsn("http_cs", "[%" PRId64 "] using accept inactivity timeout [%"PRId64" seconds]",
         con_id, HttpConfig::m_master.accept_no_activity_timeout);
   client_vc->set_inactivity_timeout(HRTIME_SECONDS(HttpConfig::m_master.accept_no_activity_timeout));
-
   client_vc->set_active_timeout(HRTIME_SECONDS(HttpConfig::m_master.transaction_active_timeout_in));
 
   transact_count++;
@@ -630,7 +629,7 @@ HttpClientSession::release(IOBufferReader * r)
     ka_vio = this->do_io_read(this, INT64_MAX, read_buffer);
     ink_assert(slave_ka_vio != ka_vio);
     client_vc->set_inactivity_timeout(HRTIME_SECONDS(ka_in));
-    client_vc->set_active_timeout(HRTIME_SECONDS(ka_in));
+    client_vc->cancel_active_timeout();
   }
 }
{code}

                
> replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout
> ---------------------------------------------------------------------------------------------
>
>                 Key: TS-1348
>                 URL: https://issues.apache.org/jira/browse/TS-1348
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Core, Network, Performance
>    Affects Versions: 3.2.0
>            Reporter: kuotai
>            Assignee: kuotai
>             Fix For: 3.3.0
>
>         Attachments: kpa_timeout.patch
>
>
> if calling set_active_timeout function in keepalive, every connection will create one event and schedule in event system. so if having more and more connection in keepalive state(more and more event in schedule system), system have to take more time to PriorityEventQueue::check_ready.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (TS-1348) replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-1348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leif Hedstrom updated TS-1348:
------------------------------

    Affects Version/s:     (was: 3.3.1)
                       3.2.0
        Fix Version/s: 3.3.0
    
> replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout
> ---------------------------------------------------------------------------------------------
>
>                 Key: TS-1348
>                 URL: https://issues.apache.org/jira/browse/TS-1348
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Core, Network, Performance
>    Affects Versions: 3.2.0
>            Reporter: kuotai
>            Assignee: kuotai
>             Fix For: 3.3.0
>
>         Attachments: kpa_timeout.patch
>
>
> if calling set_active_timeout function in keepalive, every connection will create one event and schedule in event system. so if having more and more connection in keepalive state(more and more event in schedule system), system have to take more time to PriorityEventQueue::check_ready.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TS-1348) replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-1348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416655#comment-13416655 ] 

Leif Hedstrom commented on TS-1348:
-----------------------------------

I committed a change, to cancel the active events. I spent a little time, and after your change, the old activity timers were left lingering now. They would trigger, but would (fortunately) not close the connection. I think it's better to cancel the activity timeouts completely (which the old code would effectively do). If I'm smoking crack, feel free to fix again :).
                
> replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout
> ---------------------------------------------------------------------------------------------
>
>                 Key: TS-1348
>                 URL: https://issues.apache.org/jira/browse/TS-1348
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Core, Network, Performance
>    Affects Versions: 3.2.0
>            Reporter: kuotai
>            Assignee: kuotai
>             Fix For: 3.3.0
>
>         Attachments: kpa_timeout.patch
>
>
> if calling set_active_timeout function in keepalive, every connection will create one event and schedule in event system. so if having more and more connection in keepalive state(more and more event in schedule system), system have to take more time to PriorityEventQueue::check_ready.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TS-1348) replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-1348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416370#comment-13416370 ] 

Leif Hedstrom commented on TS-1348:
-----------------------------------

So, it seems fine. I wonder if this is some oddity around the fact that we used to do these timeout events for everything, and switched to the inactivity cop ?
                
> replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout
> ---------------------------------------------------------------------------------------------
>
>                 Key: TS-1348
>                 URL: https://issues.apache.org/jira/browse/TS-1348
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Core, Network, Performance
>    Affects Versions: 3.2.0
>            Reporter: kuotai
>            Assignee: kuotai
>             Fix For: 3.3.0
>
>         Attachments: kpa_timeout.patch
>
>
> if calling set_active_timeout function in keepalive, every connection will create one event and schedule in event system. so if having more and more connection in keepalive state(more and more event in schedule system), system have to take more time to PriorityEventQueue::check_ready.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TS-1348) replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout

Posted by "kuotai (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-1348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416813#comment-13416813 ] 

kuotai commented on TS-1348:
----------------------------

yeah, if use only set_inactivity_timeout in KA, we must call cancel_active_timeout(). The additional patch:

diff --git a/proxy/http/HttpClientSession.cc b/proxy/http/HttpClientSession.cc
index 17d6945..ae6652a 100644
--- a/proxy/http/HttpClientSession.cc
+++ b/proxy/http/HttpClientSession.cc
@@ -577,6 +577,7 @@ HttpClientSession::attach_server_session(HttpServerSession * ssession, bool tran
     if (transaction_done) {
       ssession->get_netvc()->
         set_inactivity_timeout(HRTIME_SECONDS(current_reader->t_state.txn_conf->keep_alive_no_activity_timeout_out));
+      ssession->get_netvc()->cancel_active_timeout();
     } else {
       // we are serving from the cache - this could take a while.
       ssession->get_netvc()->cancel_inactivity_timeout();
@@ -628,6 +629,7 @@ HttpClientSession::release(IOBufferReader * r)
     ka_vio = this->do_io_read(this, INT64_MAX, read_buffer);
     ink_assert(slave_ka_vio != ka_vio);
     client_vc->set_inactivity_timeout(HRTIME_SECONDS(ka_in));
+    client_vc->cancel_active_timeout();
   }
 }
 

                
> replace keepalive connection timeout handle from set_active_timeout to set_inactivity_timeout
> ---------------------------------------------------------------------------------------------
>
>                 Key: TS-1348
>                 URL: https://issues.apache.org/jira/browse/TS-1348
>             Project: Traffic Server
>          Issue Type: Improvement
>          Components: Core, Network, Performance
>    Affects Versions: 3.2.0
>            Reporter: kuotai
>            Assignee: kuotai
>             Fix For: 3.3.0
>
>         Attachments: kpa_timeout.patch
>
>
> if calling set_active_timeout function in keepalive, every connection will create one event and schedule in event system. so if having more and more connection in keepalive state(more and more event in schedule system), system have to take more time to PriorityEventQueue::check_ready.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira