You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Feifei Cai (JIRA)" <ji...@apache.org> on 2015/04/03 11:57:53 UTC
[jira] [Commented] (TS-3487) cannot override
proxy.config.http.transaction_no_activity_timeout_in per remap rule for
POST methold
[ https://issues.apache.org/jira/browse/TS-3487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14394264#comment-14394264 ]
Feifei Cai commented on TS-3487:
--------------------------------
For the per remap rule use case, transaction_no_activity_timeout_in does not works due to:
{{set_inactivity_timeout(transaction_no_activity_timeout_in)}} is called in {{HttpSM::state_read_client_request_header}}, which is before remap process. But we override it after remap rule is applied. So we need to reset it with new value after remap.
What's more, per remap is only one of the use cases. Considering that an overridable setting is allowed to be overridden per transaction in any hook point, we need to {{set_inactivity_timeout(transaction_no_activity_timeout_in)}} each time before starting read/write with client, and {{set_inactivity_timeout(transaction_no_activity_timeout_out)}} with origin server. We have done this for most points in [HTTP Transaction State Diagram|https://docs.trafficserver.apache.org/en/latest/sdk/http-hooks-and-transactions.en.html#http-transaction-state-diagram], however, we seems to miss the point {{HttpSM::do_setup_post_tunnel}}.
> cannot override proxy.config.http.transaction_no_activity_timeout_in per remap rule for POST methold
> ----------------------------------------------------------------------------------------------------
>
> Key: TS-3487
> URL: https://issues.apache.org/jira/browse/TS-3487
> Project: Traffic Server
> Issue Type: Bug
> Components: HTTP
> Affects Versions: 5.2.1
> Reporter: Feifei Cai
> Attachments: TS-3487.diff
>
>
> The configuration and test are as follows:
> remap.config:
> {noformat}
> map /test1 http://httpbin.org
> map /test2 http://httpbin.org @plugin=conf_remap.so @pparam=proxy.config.http.transaction_no_activity_timeout_in=15
> {noformat}
> records.config:
> {noformat}
> CONFIG proxy.config.http.transaction_no_activity_timeout_in INT 5
> CONFIG proxy.config.diags.debug.enabled INT 1
> CONFIG proxy.config.diags.debug.tags STRING http_cs|http_ss|inactivity.*|socket
> {noformat}
> {code:title=test.py}
> import time
> import logging
> import socket
> log = logging.getLogger(__name__)
> logging.basicConfig(level=logging.INFO)
> import SocketServer
> url1 = 'POST /test1/post HTTP/1.1\r\n'
> url2 = 'POST /test2/post HTTP/1.1\r\n'
> header1 = 'Host: 127.0.0.1\r\n'
> # last header need additional '\r\n'
> header2 = 'Content-Length: 10\r\n\r\n'
> body1 = '12345'
> body2 = '67890'
> def get_socket():
> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> s.connect(('127.0.0.1', 8080))
> return s
> def test_global_config():
> s = get_socket()
> log.info('start test global config...')
> try:
> # before remap
> s.send(url1)
> time.sleep(2) # < global config
> s.send(header1)
> time.sleep(3) # < global config
> s.send(header2)
> # after remap
> time.sleep(2) # < global config
> s.send(body1)
> time.sleep(4) # < global config
> s.send(body2)
> log.info('test global config: pass!')
> except IOError:
> log.info('test global config: fail!')
> response = s.recv(4096)
> print response
> def test_per_remap_config():
> s = get_socket()
> log.info('start test per remap config...')
> try:
> # before remap
> s.send(url2)
> time.sleep(2) # < global config
> s.send(header1)
> time.sleep(3) # < global config
> s.send(header2)
> # after remap
> time.sleep(11) # < per remap config
> s.send(body1)
> time.sleep(13) # < per remap config
> s.send(body2)
> log.info('test per remap config: pass!')
> except IOError:
> log.info('test per remap config: fail!')
> response = s.recv(4096)
> print response
> if __name__ == '__main__':
> test_global_config()
> test_per_remap_config()
> {code}
> {{test_global_config()}} would pass, but {{test_per_remap_config()}} fails. {{proxy.config.http.transaction_no_activity_timeout_in}} in per remap rule does not works.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)