Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-3096

After TS-2751 TSVConnClosedGet changed its behaviour

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • None
    • None
    • TS API
    • None

    Description

      One of our plug-ins initiates a background connection to an origin by using TSHttpConnect API.

      While handling the continuation events (WRITE, READ) the plug-in checks if the vconnection is still open by calling TSVConnClosedGet(vconnection).

      ATS recently changed the behavior. Now TSVConnClosedGet(vconnections) returns a value different than 0 before any data can be retrieved.

      If the call to TSVConnClosedGet is ignored the plug-in successfully writes the request and receives the response.

      By investigation our different Traffic Server versions the described change seems to be related with TS-2751.

      Attachments

        Issue Links

          Activity

            How are you accessing the data from TSHttpConnect? There were some changes made to that semi-recently. What is the behavior in 5.1.x?

            amc Alan M. Carroll added a comment - How are you accessing the data from TSHttpConnect? There were some changes made to that semi-recently. What is the behavior in 5.1.x?

            Hi Alan,

            here's an (incomplete) example I crafted where I see the problem:

            static int fetcher(TSCont contp, TSEvent event, void *) {
            TSDebug(PLUGIN_TAG, "\n\nvconnection: %p, closed: %d, event: %d\n\n", contp, TSVConnClosedGet(contp), event);
            }

            template < class C >
            void get(const std::string & request, const C & callback) {

            struct sockaddr_in socket;

            socket.sin_family = AF_INET;
            socket.sin_port = 80;
            socket.sin_addr.s_addr = 0x0100007f;

            TSVConn vconn = TSHttpConnectWithPluginId(reinterpret_cast< sockaddr * >(&socket), PLUGIN_TAG, 0);

            if (vconn) {
            TSCont contp = TSContCreate(fetcher< C >, NULL);

            if (contp)

            { HttpConnectState< C > * state = new HttpConnectState< C >(request, vconn, callback); state->out = IO::write(vconn, contp, request.size()); TSContDataSet(contp, state); }

            }
            }

            I tested with Yahoo's Traffic Server version, so I don't know how to map that with the outside world version.

            dmorilha Daniel Vitor Morilha added a comment - Hi Alan, here's an (incomplete) example I crafted where I see the problem: static int fetcher(TSCont contp, TSEvent event, void *) { TSDebug(PLUGIN_TAG, "\n\nvconnection: %p, closed: %d, event: %d\n\n", contp, TSVConnClosedGet(contp), event); } template < class C > void get(const std::string & request, const C & callback) { struct sockaddr_in socket; socket.sin_family = AF_INET; socket.sin_port = 80; socket.sin_addr.s_addr = 0x0100007f; TSVConn vconn = TSHttpConnectWithPluginId(reinterpret_cast< sockaddr * >(&socket), PLUGIN_TAG, 0); if (vconn) { TSCont contp = TSContCreate(fetcher< C >, NULL); if (contp) { HttpConnectState< C > * state = new HttpConnectState< C >(request, vconn, callback); state->out = IO::write(vconn, contp, request.size()); TSContDataSet(contp, state); } } } I tested with Yahoo's Traffic Server version, so I don't know how to map that with the outside world version.

            It also affects the vconnection created with TSCacheRead

            dmorilha Daniel Vitor Morilha added a comment - It also affects the vconnection created with TSCacheRead
            zwoop Leif Hedstrom added a comment -

            Note sure why this was closed, reopening and moving to 5.3.0.

            zwoop Leif Hedstrom added a comment - Note sure why this was closed, reopening and moving to 5.3.0.
            zwoop Leif Hedstrom added a comment -

            Oh, this is a dupe of TS-3058. It just wasn't marked properly.

            zwoop Leif Hedstrom added a comment - Oh, this is a dupe of TS-3058 . It just wasn't marked properly.

            People

              Unassigned Unassigned
              dmorilha Daniel Vitor Morilha
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: