• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 2.0
    • None
    • None

      This interceptor's main purpose is to write the last and previous login dates for a particular user as they log in to Confluence.

      I remember when we ran some functional tests with multiple threads simulating concurrent users logging in, that there were issues in this class and I was forced to comment out the writing of these dates to allow the tests to proceed.

      A customer who setup Confluence against postgres 8 also had issues with this class. He's confluence instance was losing connections. As soon as he installed a patched version of this class with date writing commented out, he reported back that no database connections were lost. (http://support.atlassian.com/browse/CSP-1132)

            [CONFSERVER-3494] Problems in ConfluenceLoginInterceptor

            Tom Davies added a comment -

            Fixed by synchronizing on user name.

            Tom Davies added a comment - Fixed by synchronizing on user name.

            Hi Dave,

            Thank you for the explanation. I verified that we don't have any long values for date properties using "select * from os_propertyentry where entity_key like '%.login.date' and key_type<>7".

            After I commented out remove() calls for both properties everything works fine.

            There is a relatively simple way to reproduce the problem. If you have a Windows workstation, subscribe to 2 or more space newsfeeds in SharpReader and try to refresh all of them at once. This should generate a stack dump in the server log file. In our test environment only SharpReader breaks Confluence, Mozilla Thunderbird works fine.

            Dzmitry

            Dzmitry Zhemchuhou added a comment - Hi Dave, Thank you for the explanation. I verified that we don't have any long values for date properties using "select * from os_propertyentry where entity_key like '%.login.date' and key_type<>7". After I commented out remove() calls for both properties everything works fine. There is a relatively simple way to reproduce the problem. If you have a Windows workstation, subscribe to 2 or more space newsfeeds in SharpReader and try to refresh all of them at once. This should generate a stack dump in the server log file. In our test environment only SharpReader breaks Confluence, Mozilla Thunderbird works fine. Dzmitry

            The way in which these dates were stored in the database was changed from long values to actual dates. The remove was used to migrate to the new storage format and resolve class cast exceptions on reading of legacy values.

            dave (Inactive) added a comment - The way in which these dates were stored in the database was changed from long values to actual dates. The remove was used to migrate to the new storage format and resolve class cast exceptions on reading of legacy values.

            I looked into this problem myself and I found that the last login date as well as the previous login date are both updated by first removing the corresponding properties and then setting them with new values. This translates into a pair of DELETE / INSERT statements per property, where an UPDATE statement would be more logical.

            Is there any particular reason to use user.getPropertySet.remove() in ConfluenceLoginInterceptor?

            Thanks,
            Dzmitry Zhemchuhou

            Dzmitry Zhemchuhou added a comment - I looked into this problem myself and I found that the last login date as well as the previous login date are both updated by first removing the corresponding properties and then setting them with new values. This translates into a pair of DELETE / INSERT statements per property, where an UPDATE statement would be more logical. Is there any particular reason to use user.getPropertySet.remove() in ConfluenceLoginInterceptor? Thanks, Dzmitry Zhemchuhou

              Unassigned Unassigned
              dave@atlassian.com dave (Inactive)
              Affected customers:
              1 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: