You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by jpeach <gi...@git.apache.org> on 2016/04/29 00:13:37 UTC

[GitHub] trafficserver pull request: TS-4388: Fix TSHttpTxnParentProxySet

GitHub user jpeach opened a pull request:

    https://github.com/apache/trafficserver/pull/606

    TS-4388: Fix TSHttpTxnParentProxySet

    This PR fixes ``TSHttpTxnParentProxySet``.
    
    The first two commits are minor cleanups of cruft. The third one fixes the API tests so that they don't interfere with each other when they register multiple global hooks. The final one actually fixes the ``TSHttpTxnParentProxySet`` API, primarily by restricting access to private ``ParentResult`` data and providing accessors that enforce the correct policy.
    
    I've tested that this works correctly with the tests and with my plugin. I don't have any way to test that I haven't broken the various parent retry features.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jpeach/trafficserver jpeach/parent-proxy-api

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafficserver/pull/606.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #606
    
----
commit 295908ee95fed93c469a1b96508d0fab12609650
Author: James Peach <jp...@apache.org>
Date:   2016-04-27T18:12:11Z

    TS-4388: Remove useless record API defines.

commit 10b81dbfead0238a62d6dde832172e6f14528da6
Author: James Peach <jp...@apache.org>
Date:   2016-04-27T18:20:25Z

    TS-4388: Remove unused HttpConfig::parent_proxy_routing_enable.

commit 1c32eba4449787153b5b232b69c1e30497fb0647
Author: James Peach <jp...@apache.org>
Date:   2016-04-28T20:02:38Z

    TS-4388: Fix global hook handling in API tests.
    
    Many of the API regression tests work by trampolining off a global
    hook (which is really waht you have to do). However, there's no way
    to unregister a global hook, so once the test is done, it needs to
    be careful to co-operate with the remaining tests. We clear the
    continuation data, and if is is clear, we either ignore the event
    or re-enable the HTTP transaction.

commit 2cf6f9a99e1176a8d97529ef9c4eb4d0a8aa437a
Author: James Peach <jp...@apache.org>
Date:   2016-04-27T22:16:32Z

    TS-4388: TSHttpTxnParentProxySet crashes in parent selection.
    
    Fix ParentResult to handle the case where the parent is specified
    by the TSHttpTxnParentProxySet API. Encapsulate the internals of
    the result better so that it is easier for the HTTP state machine
    to do the right thing.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-4388: Fix TSHttpTxnParentProxySet

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on the pull request:

    https://github.com/apache/trafficserver/pull/606#issuecomment-215619876
  
    The actual fix is to avoid dereferencing the ``rec`` pointer when it has the API sentinel value. I could have just make a small fix to the code path that I happened to hit, but I wanted to make it robust in all cases. I could have separated out each usage of ``rec`` into a separate commit (which was actually how I worked this). It would be a long series.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-4388: Fix TSHttpTxnParentProxySet

Posted by zwoop <gi...@git.apache.org>.
Github user zwoop commented on the pull request:

    https://github.com/apache/trafficserver/pull/606#issuecomment-215751946
  
    I agree with Phil, since the refactoring (variable name changes) is so big, it would be much nicer to have this as two separate PRs.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-4388: Fix TSHttpTxnParentProxySet

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on the pull request:

    https://github.com/apache/trafficserver/pull/606#issuecomment-215625974
  
    I looked at the diff again, and though there are a few changes here, they are pretty obvious in a side-by-side diff. Basically every place that follows ``parent_record.rec`` unchecked is a bug.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-4388: Fix TSHttpTxnParentProxySet

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on the pull request:

    https://github.com/apache/trafficserver/pull/606#issuecomment-215932527
  
    OK I broke out some refactoring into 2 additional commits.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-4388: Fix TSHttpTxnParentProxySet

Posted by PSUdaemon <gi...@git.apache.org>.
Github user PSUdaemon commented on the pull request:

    https://github.com/apache/trafficserver/pull/606#issuecomment-215619566
  
    The 4th commit is so much refactoring with no change in behavior that it's hard to follow what the actual fix is. I agree that `r` is a poor variable name, and a lot of the other changes do make the code clearer. Would be nice to separate them out as you did in the other commits.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-4388: Fix TSHttpTxnParentProxySet

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach closed the pull request at:

    https://github.com/apache/trafficserver/pull/606


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-4388: Fix TSHttpTxnParentProxySet

Posted by PSUdaemon <gi...@git.apache.org>.
Github user PSUdaemon commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/606#discussion_r61531390
  
    --- Diff: proxy/http/HttpConfig.cc ---
    @@ -888,8 +888,6 @@ HttpConfig::startup()
       HttpEstablishStaticConfigLongLong(c.origin_min_keep_alive_connections, "proxy.config.http.origin_min_keep_alive_connections");
       HttpEstablishStaticConfigLongLong(c.oride.attach_server_session_to_client, "proxy.config.http.attach_server_session_to_client");
     
    -  HttpEstablishStaticConfigByte(c.parent_proxy_routing_enable, "proxy.config.http.parent_proxy_routing_enable");
    -
       // Wank me.
    --- End diff --
    
    Didn't think this cruft was worth removing? ;-)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-4388: Fix TSHttpTxnParentProxySet

Posted by PSUdaemon <gi...@git.apache.org>.
Github user PSUdaemon commented on the pull request:

    https://github.com/apache/trafficserver/pull/606#issuecomment-215622970
  
    I like the robustness, it's just hard to tell that this commit is anything more than a refactor. I'd just separate the small fix out and leave the rest as one patch.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-4388: Fix TSHttpTxnParentProxySet

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on the pull request:

    https://github.com/apache/trafficserver/pull/606#issuecomment-215578712
  
    Ping @zwoop @PSUdaemon @jrushford 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-4388: Fix TSHttpTxnParentProxySet

Posted by zwoop <gi...@git.apache.org>.
Github user zwoop commented on the pull request:

    https://github.com/apache/trafficserver/pull/606#issuecomment-215984159
  
    +1 on the refactoring / commits.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-4388: Fix TSHttpTxnParentProxySet

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on the pull request:

    https://github.com/apache/trafficserver/pull/606#issuecomment-216290646
  
    Merged.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-4388: Fix TSHttpTxnParentProxySet

Posted by JamesPeach <gi...@git.apache.org>.
Github user JamesPeach commented on the pull request:

    https://github.com/apache/trafficserver/pull/606#issuecomment-215581577
  
    The 99% case in the code is ``parent_result.result`` which didn't seem too bad to me. I hated, hated, hated ``parent_result.r`` ;)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-4388: Fix TSHttpTxnParentProxySet

Posted by zwoop <gi...@git.apache.org>.
Github user zwoop commented on the pull request:

    https://github.com/apache/trafficserver/pull/606#issuecomment-215579807
  
    I'm not sure I'm in love with
    
        result->result
    
    That seems pretty redundant. If you are going to bike shed this, maybe result->rc, or result->result_code or result->state ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---