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

RemapPlugin class doesn't work correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 7.0.0
    • CPP API
    • None

    Description

      Current atscppapi::RemapPlugin has two issues. These seem to be caused by missing utils::internal::initTransactionManagement() call.

      First, after TS-4555, plugins uses RemapPlugin class doesn't work because it can't pass an assertion.

      # my remap.config. It uses RemapPlugin, one of atscppapi examples.
      map / http://127.0.0.1:80/ @plugin=RemapPlugin.so
      
      $ lldb /path/to/traffic_server
      ...
      (lldb) r
      ...
      (lldb) bt
      ...
      * thread #7: tid = 0x3ce4eef, 0x00007fff886d0f06 libsystem_kernel.dylib`__pthread_kill + 10, name = '[ET_NET 4]', stop reason = signal SIGABRT
        * frame #0: 0x00007fff886d0f06 libsystem_kernel.dylib`__pthread_kill + 10
          frame #1: 0x00007fff91d6b4ec libsystem_pthread.dylib`pthread_kill + 90
          frame #2: 0x00007fff902b56df libsystem_c.dylib`abort + 129
          frame #3: 0x0000000000039799 libtsutil.7.dylib`ink_abort(message_format="%s:%d: failed assertion `%s`") + 361 at ink_error.cc:79
          frame #4: 0x000000000003703f libtsutil.7.dylib`::_ink_assert(expression="arg_idx >= 0 && arg_idx < HTTP_SSN_TXN_MAX_USER_ARG", file="InkAPI.cc", line=5881) + 47 at ink_assert.cc:37
          frame #5: 0x00000001000446c3 traffic_server`::_TSReleaseAssert(text="arg_idx >= 0 && arg_idx < HTTP_SSN_TXN_MAX_USER_ARG", file="InkAPI.cc", line=5881) + 35 at InkAPI.cc:396
          frame #6: 0x0000000100054e0f traffic_server`::TSHttpTxnArgGet(txnp=0x0000000005d6b200, arg_idx=-1) + 111 at InkAPI.cc:5881
          frame #7: 0x000000000579bb9b libatscppapi.7.dylib`atscppapi::utils::internal::getTransaction(ats_txn_handle=0x0000000005d6b200) + 27 at utils_internal.cc:159
          frame #8: 0x00000000057bba8c libatscppapi.7.dylib`::TSRemapDoRemap(ih=0x0000000000759fe0, rh=0x0000000005d6b200, rri=0x000070000058df08) + 108 at RemapPlugin.cc:35
          frame #9: 0x00000001001cb79e traffic_server`RemapPlugins::run_plugin(this=0x000070000058e0e8, plugin=0x0000000000759f90) + 350 at RemapPlugins.cc:75
          frame #10: 0x00000001001cb9c3 traffic_server`RemapPlugins::run_single_remap(this=0x000070000058e0e8) + 435 at RemapPlugins.cc:111
      ...
      

      Second, Remap Plugin remains an another issue if we simply revert https://github.com/apache/trafficserver/commit/17fdb2fd7dc47d09f8c8d7f9b6ff27b035c00d85. Objects of atscppapi::Transaction is created correctly at utils_internal.cc, but its destructor is never called.

      # Revert and rebuild ATS
      $ git revert 17fdb2fd7dc47d09f8c8d7f9b6ff27b035c00d85 --no-commit
      ...
      $ make && make install
      
      $ lldb /path/to/traffic_server
      ...
      (lldb) r
      ...
      # It can pass the assertion! but ...
      
      (lldb) b -M ~Transaction
      (lldb) r
      # atscppapi::Transaction::~Transaction() is not called.
      

      Attachments

        Issue Links

          Activity

            People

              briang Brian Geffon
              rokubo Ryo Okubo
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h