2 Replies Latest reply: Feb 25, 2011 3:15 PM by 707207 RSS

    should the application call tpabort upon handling a signal? (Usignal used)

    707207
      Hi all

      And thanks in advance.

      We currently performing RAC failover tests.
      All our servers handle SIGSEGV signal using Usignal.

      We have 2 open questions:

      1. should we call tpabort upon receiving a signal like SIGSEGV ( for services called by TMQFORWARD ) ?
      * sound like we shouldn't as we are not the transaction owner. (TMQFORWARD is the transaction owner)

      2. should we call tpabort upon receiving a signal like SIGSEGV ( for services that manually control transaction i.e call tpbegin\tpcommit\tpabort ) ?
      * sound like we should as we are the transaction owner.


      Many Thanks
      TechSgin
        • 1. Re: should the application call tpabort upon handling a signal? (Usignal used)
          Todd Little-Oracle
          Hi TechSign,

          Tuxedo adheres to the XA standard which requires checked transaction semantics. Specifically what that means is:

          1. tpabort() and tpcommit() can only be performed by the caller of tpbegin(), i.e., the aborter or committer of the transaction must be at the same level that called tpbegin(). So yes, if your service was called by TMQFORWARD and TMQFORWARD started the transaction, the only option your service has to abort the transaction is to perform a tpreturn with TPFAIL as the return code.

          2. All activity within the boundaries of the transaction must be completed before tpabort() or tpcommit() are called. In other words, you can finish a transaction while there is outstanding activity such as service calls performed with tpacall(). This probably doesn't directly apply to you.

          In all honesty, if you receive a SIGSEGV signal, shouldn't the server just roll over and die? I mean do you really want the server to continue processing requests if it tried to access memory it shouldn't have accessed? In this case your signal handler should just exit the process. If the current service being handled was in a transaction, the transaction will be marked rollback only and will fail to commit whenever the beginner of the transaction tries to commit the transactions (such as an AUTOTRAN transaction).

          Regards,
          Todd Little
          Oracle Tuxedo Chief Architect