Bug 1314608

Summary: Serialization error when updating last seen date
Product: [Community] Bugzilla Reporter: Matt Tyson 🤬 <mtyson>
Component: DatabaseAssignee: Matt Tyson 🤬 <mtyson>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 4.4CC: huiwang, jmcdonal, mtahir, qgong
Target Milestone: 4.4   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.4.11050.3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-29 00:29:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Matt Tyson 🤬 2016-03-04 04:01:37 UTC
Serialization error when updating the users last seen date.

This isn't really important enough to warrant proper serialization here.  We'll lessen the isolation level for this operation.


[Bugzilla::Error::ThrowUserError /var/www/html/bugzilla/Bugzilla/Error.pm (155)] - ThrowUserError: $VAR1 = 'db_sync_error_web';
$VAR2 = {
          'query' => 'UPDATE profiles SET last_seen_date = ? WHERE userid = ? at /var/www/html/bugzilla/Bugzilla/User.pm line 294
        Bugzilla::User::update_last_seen_date(\'Bugzilla::User=HASH(0x7f55c6f5ee80)\') called at /var/www/html/bugzilla/Bugzilla.pm line 541
        Bugzilla::login(\'Bugzilla\') called at /var/www/html/bugzilla/show_bug.cgi line 23
        ModPerl::ROOT::Bugzilla::ModPerl::ResponseHandler::var_www_html_bugzilla_show_bug_2ecgi::handler(\'Apache2::RequestRec=SCALAR(0x7f55c71f8fe0)\') called at /usr/lib64/perl5/vendor_perl/ModPerl/RegistryCooker.pm line 204
        eval {...} called at /usr/lib64/perl5/vendor_perl/ModPerl/RegistryCooker.pm line 204
        ModPerl::RegistryCooker::run(\'Bugzilla::ModPerl::ResponseHandler=HASH(0x7f55c60c8cd8)\') called at /usr/lib64/perl5/vendor_perl/ModPerl/RegistryCooker.pm line 170
        ModPerl::RegistryCooker::default_handler(\'Bugzilla::ModPerl::ResponseHandler=HASH(0x7f55c60c8cd8)\') called at /usr/lib64/perl5/vendor_perl/ModPerl/Registry.pm line 31
        ModPerl::Registry::handler(\'Bugzilla::ModPerl::ResponseHandler\', \'Apache2::RequestRec=SCALAR(0x7f55c71f8fe0)\') called at /var/www/html/bugzilla/mod_perl.pl line 134
        Bugzilla::ModPerl::ResponseHandler::handler(\'Bugzilla::ModPerl::ResponseHandler\', \'Apache2::RequestRec=SCALAR(0x7f55c71f8fe0)\') called at -e line 0
        eval {...} called at -e line 0
'
        };

Comment 1 Rony Gong 🔥 2016-03-07 12:26:56 UTC
QE checked the code, and added a transaction to the UPDATE profiles.
QE verified this on 4.4.11050-1, Executing following scripts, it could reproduce the Serialization error when test against the old version, but couldn't reproduce when test against the fixed version.

#!/usr/bin/python

import thread
import time
import xmlrpclib

# Define a function for the thread
def print_time( threadName, delay):
   count = 0
   while count < 5:
      time.sleep(delay)
      count += 1
      print "%s: %s" % ( threadName, time.ctime(time.time()) )

def xmlrpc_access( threadName, delay):
   count = 0
   while count < 10:
      time.sleep(delay)
      proxy = xmlrpclib.ServerProxy('https://bugzilla-qe-05.host.stage.eng.rdu2.redhat.com/xmlrpc.cgi')
#      proxy = xmlrpclib.ServerProxy('https://bzperfweb01.app.qa.eng.nay.redhat.com/xmlrpc.cgi')
      
      response = proxy.User.login({'Bugzilla_login': 'redhat1', 'Bugzilla_password': '*********'})
      count += 1
      print "%s: %s: %s" % ( response, threadName, time.ctime(time.time()) )

# Create two threads as follows
try:
   thread.start_new_thread( xmlrpc_access, ("Thread-1", 0, ) )
   thread.start_new_thread( xmlrpc_access, ("Thread-2", 0, ) )
   thread.start_new_thread( xmlrpc_access, ("Thread-2", 0, ) )
   thread.start_new_thread( xmlrpc_access, ("Thread-2", 0, ) )
except:
   print "Error: unable to start thread"

while 1:
   pass