[jira] [Commented] (TS-4539) The mutex of server_vc is not set while server_session reuse
[ https://issues.apache.org/jira/browse/TS-4539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15528725#comment-15528725 ] Oknet Xu commented on TS-4539: -- This is not a bug, but I found another bug in ServerSessionPool and HttpSessionManager. A VC cannot be migrated to other EThreads while it is allocated. It is managed by NetHandler running in the same EThread. The NetHandler own the VC and the VC is only freed by the NetHandler. InactivityCop is a part of NetHandler due to they are share same mutex therefore, similar to NetHandler, it could free the VC. > The mutex of server_vc is not set while server_session reuse > > > Key: TS-4539 > URL: https://issues.apache.org/jira/browse/TS-4539 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Oknet Xu >Assignee: Oknet Xu > Fix For: 7.1.0 > > > NetAccept got a client_vc and call new_ProxyMutex() to assign a mutex. > And the HttpClientSession, HttpSM, HttpServerSession, server_vc also share > the same mutex. > The HttpServerSession and server_vc will put into ServerSessionPool and may > assign to next new client_vc. > The HttpSM::attach_server_session() only set the mutex of HttpServerSession > to the mutex of HttpSM after get a HttpServerSession from ServerSessionPool. > But it forget to set the mutex of server_vc to the mutex of HttpSM. > > {code} > void > HttpSM::attach_server_session(HttpServerSession *s) > { > hsm_release_assert(server_session == NULL); > hsm_release_assert(server_entry == NULL); > hsm_release_assert(s->state == HSS_ACTIVE); > server_session = s; > server_session->transact_count++; > // Set the mutex so that we have something to update > // stats with > server_session->mutex = this->mutex; > {code} > But I can not found any issue, Is it by design? > Or it is hard to locate the problem, due to my limited knowedge on HttpSM. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-4539) the mutex of server_vc is not set while server_session reuse.
[ https://issues.apache.org/jira/browse/TS-4539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15333670#comment-15333670 ] Oknet Xu commented on TS-4539: -- Client_vc->mutex is alloced in NetAccept by {code}vc->mutex = new_ProxyMutex();{code} and Server_vc->mutex is set to {code}vc->mutex = cont->mutex;{code} in UnixNetProcessor::connect_re_internal(). the connect_re_internal() is called by NetProcessor::connect_re(). {code} if (scheme_to_use == URL_WKSIDX_HTTPS) { DebugSM("http", "calling sslNetProcessor.connect_re"); int len = 0; const char *host = t_state.hdr_info.server_request.host_get(); if (host && len > 0) opt.set_sni_servername(host, len); connect_action_handle = sslNetProcessor.connect_re(this, // state machine _state.current.server->dst_addr.sa, // addr + port ); } else { if (t_state.method != HTTP_WKSIDX_CONNECT) { DebugSM("http", "calling netProcessor.connect_re"); connect_action_handle = netProcessor.connect_re(this, // state machine _state.current.server->dst_addr.sa, // addr + port ); } else { {code} acroding the above code in HttpSM::do_http_server_open(), the cont is HttpSM. the Server_vc->mutex is set to HttpSM->mutex. the Server_vc->mutex is not set to EThread->mutex as your said. > the mutex of server_vc is not set while server_session reuse. > - > > Key: TS-4539 > URL: https://issues.apache.org/jira/browse/TS-4539 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Oknet Xu > > NetAccept got a client_vc and call new_ProxyMutex() to assign a mutex. > And the HttpClientSession, HttpSM, HttpServerSession, server_vc also share > the same mutex. > The HttpServerSession and server_vc will put into ServerSessionPool and may > assign to next new client_vc. > The HttpSM::attach_server_session() only set the mutex of HttpServerSession > to the mutex of HttpSM after get a HttpServerSession from ServerSessionPool. > But it forget to set the mutex of server_vc to the mutex of HttpSM. > > {code} > void > HttpSM::attach_server_session(HttpServerSession *s) > { > hsm_release_assert(server_session == NULL); > hsm_release_assert(server_entry == NULL); > hsm_release_assert(s->state == HSS_ACTIVE); > server_session = s; > server_session->transact_count++; > // Set the mutex so that we have something to update > // stats with > server_session->mutex = this->mutex; > {code} > But I can not found any issue, Is it by design? > Or it is hard to locate the problem, due to my limited knowedge on HttpSM. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-4539) the mutex of server_vc is not set while server_session reuse.
[ https://issues.apache.org/jira/browse/TS-4539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15330103#comment-15330103 ] Susan Hinrichs commented on TS-4539: We don't change the mutex associated with server_vc when moving them in and out of the session pool. Actually we don't change the mutex of the ServerSession when moving into the pool either. The Server_vc->mutex shouldn't need to change. Either it came in and out of a thread pool, in which case it should still be using the mutex of the Ethread. Or it came out of a global pool, and we migrated it as necessary to it should have the mutex of the current EThread. Not entirely sure why we reassign the ServerSession mutex in HttpSM::attach_server_session(). The comment ahead of it doesn't make much sense to me. I don't think this part of the logic has changed from 5.3 to 6.x. Have you had problems with it? > the mutex of server_vc is not set while server_session reuse. > - > > Key: TS-4539 > URL: https://issues.apache.org/jira/browse/TS-4539 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Oknet Xu > > NetAccept got a client_vc and call new_ProxyMutex() to assign a mutex. > And the HttpClientSession, HttpSM, HttpServerSession, server_vc also share > the same mutex. > The HttpServerSession and server_vc will put into ServerSessionPool and may > assign to next new client_vc. > The HttpSM::attach_server_session() only set the mutex of HttpServerSession > to the mutex of HttpSM after get a HttpServerSession from ServerSessionPool. > But it forget to set the mutex of server_vc to the mutex of HttpSM. > > {code} > void > HttpSM::attach_server_session(HttpServerSession *s) > { > hsm_release_assert(server_session == NULL); > hsm_release_assert(server_entry == NULL); > hsm_release_assert(s->state == HSS_ACTIVE); > server_session = s; > server_session->transact_count++; > // Set the mutex so that we have something to update > // stats with > server_session->mutex = this->mutex; > {code} > But I can not found any issue, Is it by design? > Or it is hard to locate the problem, due to my limited knowedge on HttpSM. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-4539) the mutex of server_vc is not set while server_session reuse.
[ https://issues.apache.org/jira/browse/TS-4539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15329909#comment-15329909 ] Leif Hedstrom commented on TS-4539: --- [~shinrich] Does this relate in any way to TS-4529 and TS-4478? And if so, is this another back port candidate for 6.2.0 ? > the mutex of server_vc is not set while server_session reuse. > - > > Key: TS-4539 > URL: https://issues.apache.org/jira/browse/TS-4539 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Reporter: Oknet Xu > > NetAccept got a client_vc and call new_ProxyMutex() to assign a mutex. > And the HttpClientSession, HttpSM, HttpServerSession, server_vc also share > the same mutex. > The HttpServerSession and server_vc will put into ServerSessionPool and may > assign to next new client_vc. > The HttpSM::attach_server_session() only set the mutex of HttpServerSession > to the mutex of HttpSM after get a HttpServerSession from ServerSessionPool. > But it forget to set the mutex of server_vc to the mutex of HttpSM. > > {code} > void > HttpSM::attach_server_session(HttpServerSession *s) > { > hsm_release_assert(server_session == NULL); > hsm_release_assert(server_entry == NULL); > hsm_release_assert(s->state == HSS_ACTIVE); > server_session = s; > server_session->transact_count++; > // Set the mutex so that we have something to update > // stats with > server_session->mutex = this->mutex; > {code} > But I can not found any issue, Is it by design? > Or it is hard to locate the problem, due to my limited knowedge on HttpSM. -- This message was sent by Atlassian JIRA (v6.3.4#6332)