1 2 Previous Next 18 Replies Latest reply on Dec 4, 2013 5:05 AM by tomjenkinson

    Can these log lines be removed?

    paul.robinson

      All,


      The following log lines appear a lot when TRACE is enabled for 'com.arjuna':

       

      CountMessage
      6562013-11-29 08:08:14,893 TRACE [com.arjuna.ats.jta] (EJB default - 1) BaseTransaction.getStatus
      662013-11-28 11:42:00,005 TRACE [com.arjuna.ats.jta] (EJB default - 5) TransactionSynchronizationRegistryImple.getTransactionKey
      662013-11-28 11:35:17,532 TRACE [com.arjuna.ats.jta] (ServerService Thread Pool – 56) TransactionImpleManager.suspend
      5442013-11-28 11:35:15,926 TRACE [com.arjuna.ats.jta] (ServerService Thread Pool – 52) TransactionSynchronizationRegistryImple.getTransactionStatus

       

      A total of almost 1,200 lines combined for those three messages after running a single transaction. This makes it a pain to read through the logs as you need to fight through pages of these statements.

      The Transaction Analyser could filter out these lines programmatically (and it does IIRC). However, this tool is just doing what a user would have to if they where diagnosing such issues without tooling support. It's also a pain for developers working on this tool, as they have to work a lot with the logs to automate the analysis process.

      I don't think they provide any value in their current form. Can they either be removed or improved?

      See here for Jira issue: [JBTM-2040] Remove some noisy logging that adds no value - JBoss Issue Tracker

        • 1. Re: Can these log lines be removed?
          tomjenkinson

          I would be tempted to focus more on those that are in the hundreds than those two at a count of 66.

           

          In terms of the BaseTransaction.getStatus and TransactionSynchronizationRegistryImple.getTransactionStatus, would they happen to be proceeded by anything that implied for certain that they were about to be called. It would be worth finding out why those calls are made so much, there could be a performance optimization there?

          • 2. Re: Can these log lines be removed?
            mmusgrov

            I suspect the gets are not that useful (eg the state can be inferred since I believe we log each transaction state change) but the suspend probably is (unless like Marks says you can infer suspend from other log statements)

            • 3. Re: Can these log lines be removed?
              paul.robinson

              The suspend was the one I thought might be useful. In which case I would expect corresponding 'resume' lines to be present, otherwise I'm not sure it's that much use.

               

              I only found one in my log:

               

                  2013-11-29 08:08:14,585 TRACE [com.arjuna.ats.jta] (default task-20) TransactionImpleManager.resume

              • 4. Re: Can these log lines be removed?
                mmusgrov

                Knowing that the thread is no longer associated is still useful even without the corresponding resume (but of course we should add that in preference to removing the suspend trace).

                • 5. Re: Can these log lines be removed?
                  tomjenkinson

                  I found it odd that the threads were different, but I think the messages could have been picked at random out of the log?

                   

                  Anyway, definitely we can remove:

                  TransactionSynchronizationRegistryImple.getTransactionStatus

                  As that can only end up with an NPE (which I don't think is possible but just covering myself), or the call to:

                  BaseTransaction.getStatus

                  • 6. Re: Can these log lines be removed?
                    tomjenkinson

                    I would still like to know why we need to call getStatus 600+ times for a transaction, for JTS that will add 600 RPC per transaction (well, once the tx is completed and before the transaction is started we use a cached value, so it would be at most 600+). Do you know where the calls are coming from and at what stage? Maybe we should only trace if we are about to RPC rather than when we are just returning an int to a caller.

                     

                    ....

                     

                    I just checked, most of those calls to getTransactionStatus will be returning

                    javax.transaction.Status.STATUS_NO_TRANSACTION

                     

                    You can tell from the log if they are returning something else because they are followed by:

                    TransactionImple.getStatus: javax.transaction.Status.<BLAH>

                     

                    I think I would just move the debug down to here:

                    https://github.com/jbosstm/narayana/blob/master/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/BaseTransaction.java#L173

                     

                    That being said, it is a worrying precedent to remove logging in order that the tool works. But I do take the rationale that it simplifies the log for none-tooled users too.

                    • 7. Re: Can these log lines be removed?
                      tomjenkinson

                      Just to summarise, the thing I am happy to do is remove "TransactionSynchronizationRegistryImple.getTransactionStatus"

                       

                      My topic of discussion would be whether it is safe to move the "BaseTransaction.getStatus" to when we are going to query the transaction object as I mentioned might be possible above. The drawback is that if there is no transaction on the thread and a user calls getStatus there is no logging from the transaction manager to assist debugging an issue (well I suppose you could say if the call succeeded the and there was no logging then you would know that it was returning STATUS_NO_TRANSACTION. Possibly you could say the caller should have some additional debug to help them with an issue in that area? I don't see that we call TransactionManager::getStatus internally and rely on that value so the only calls should be from none-JBTM code.

                      • 8. Re: Can these log lines be removed?
                        mmusgrov

                        I think I would just move the debug down to here:

                        https://github.com/jbosstm/narayana/blob/master/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/BaseTransaction.java#L173

                         

                        That being said, it is a worrying precedent to remove logging in order that the tool works. But I do take the rationale that it simplifies the log for none-tooled users too.

                        I doubt it would ever be useful to know that someone has called getStatus since the actual status should always be inferable from previous log messages.

                         

                        Also I don't think Paul is doing this to simplify the tool, rather it's an observation that we are doing a lot of logging whose benefits are dubious,

                        • 9. Re: Can these log lines be removed?
                          paul.robinson

                          Michael Musgrove wrote:

                               Also I don't think Paul is doing this to simplify the tool, rather it's an observation that we are doing a lot of logging whose benefits are dubious,

                          This is correct. It's also anoying as a developer of the tool to have to wade through all these lines, when deciding which log lines to work with.

                          • 10. Re: Can these log lines be removed?
                            tomjenkinson

                            So are you happy to modify your request to:

                             

                            1. Remove "TransactionSynchronizationRegistryImple.getTransactionStatus"

                            2. Leave "TransactionSynchronizationRegistryImple.getTransactionKey" as is

                            3. Leave "TransactionImpleManager.suspend" as is

                            4. Report "BaseTransaction.getStatus" only when we are not returning a STATUS_NO_TRANSACTION

                             

                            By my calculations that would leave (there are 47 BaseTransaction.getStatus in the log that would be kept) 179 of the original 1332

                            • 11. Re: Can these log lines be removed?
                              mmusgrov

                              You ignored my earlier comment:

                               

                              I doubt it would ever be useful to know that someone has called getStatus since the actual status should always be inferable from previous log messages.

                              • 12. Re: Can these log lines be removed?
                                mmusgrov

                                And why is one status less important than the others?

                                • 13. Re: Can these log lines be removed?
                                  tomjenkinson

                                  Well the transaction has no status, it doesn't exist.

                                  • 14. Re: Can these log lines be removed?
                                    mmusgrov

                                    So the caller thinks there may be a transaction present otherwise he wouldn't have bothered making the call - I would argue that's more than enough reason to log the situation.

                                    1 2 Previous Next