Edgewall Software

Ticket #6219 (reopened defect)

Opened 13 months ago

Last modified 3 weeks ago

Error on trac setup on RHEL5 with sqllite

Reported by: pranavbhasin@… Owned by: anonymous
Priority: normal Milestone: 0.13
Component: notification Version:
Severity: normal Keywords: smtp pool
Cc:

Description (last modified by eblot) (diff)

All database activites are taking a long time - creation of a ticket always times out though the ticket gets saved properly and now I am consistently getting this error while hitting any page that makes a database call.

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 406, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 183, in dispatch
    req.perm = PermissionCache(self.env, req.authname)
  File "/usr/lib/python2.4/site-packages/trac/perm.py", line 263, in __init__
    self.perms = PermissionSystem(env).get_user_permissions(username)
  File "/usr/lib/python2.4/site-packages/trac/perm.py", line 227, in get_user_permissions
    for perm in self.store.get_user_permissions(username):
  File "/usr/lib/python2.4/site-packages/trac/perm.py", line 109, in get_user_permissions
    db = self.env.get_db_cnx()
  File "/usr/lib/python2.4/site-packages/trac/env.py", line 203, in get_db_cnx
    return DatabaseManager(self).get_connection()
  File "/usr/lib/python2.4/site-packages/trac/db/api.py", line 76, in get_connection
    return self._cnx_pool.get_cnx(self.timeout or None)
  File "/usr/lib/python2.4/site-packages/trac/db/pool.py", line 107, in get_cnx
    raise TimeoutError('Unable to get database '
TimeoutError: Unable to get database connection within 20 seconds

Attachments

Change History

Changed 13 months ago by eblot

  • keywords needinfo added
  • description modified (diff)

Which version of Trac do you use?

Changed 13 months ago by pranavbhasin@…

Here is the environment information: Trac 0.10 Sqlite 3.3.6 Pysqlite 2.3.3 Python 2.4.3

It appears to me that the database connection is not being closed at the end of each request, which causes the page not to refresh after the data has been saved and eventually causes the database to run out of connections.

Changed 13 months ago by pranavbhasin@…

  • status changed from new to closed
  • resolution set to worksforme

Found the issue: The problem was with the smtp server not being reachable.

Changed 13 months ago by cboos

  • keywords smtp added; needinfo removed
  • resolution worksforme deleted
  • status changed from closed to reopened
  • component changed from general to notification
  • milestone set to 0.12

Same thing happened on t.e.o recently. I think we should be able to cope with this situation, for increased robustness.

There should be a mechanism in place so that requests don't get stuck forever waiting for delivery. Looks like Python 2.6 allows to specify a timeout in SMTP(). Could we find some workaround for older versions?

Changed 12 months ago by eric.descargues@…

  • priority changed from normal to highest
  • severity changed from normal to blocker

We have the same problem and an Apache server restart doesn't correct the problem. Traceback (most recent call last):

File "D:\trac\Python24\lib\site-packages\trac\web\main.py", line 406, in dispatch_request

dispatcher.dispatch(req)

File "D:\trac\Python24\lib\site-packages\trac\web\main.py", line 191, in dispatch

chosen_handler = self._pre_process_request(req, chosen_handler)

File "D:\trac\Python24\lib\site-packages\trac\web\main.py", line 263, in _pre_process_request

chosen_handler = f.pre_process_request(req, chosen_handler)

File "D:\trac\Python24\lib\site-packages\trac\versioncontrol\api.py", line 73, in pre_process_request

self.get_repository(req.authname).sync()

File "D:\trac\Python24\lib\site-packages\trac\versioncontrol\api.py", line 96, in get_repository

db = self.env.get_db_cnx() # prevent possible deadlock, see #4465

File "D:\trac\Python24\lib\site-packages\trac\env.py", line 203, in get_db_cnx

return DatabaseManager?(self).get_connection()

File "D:\trac\Python24\lib\site-packages\trac\db\api.py", line 76, in get_connection

return self._cnx_pool.get_cnx(self.timeout or None)

File "D:\trac\Python24\lib\site-packages\trac\db\pool.py", line 107, in get_cnx

raise TimeoutError?('Unable to get database '

TimeoutError?: Unable to get database connection within 20 seconds

Do you suggest a workaround ?

Changed 6 months ago by anonymous

  • status changed from reopened to closed
  • resolution set to fixed

Changed 6 months ago by ebray <hyugaricdeau@…>

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 4 months ago by anonymous

  • owner changed from jonas to Test
  • status changed from reopened to new

Changed 3 months ago by anonymous

  • owner changed from Test to anonymous
  • status changed from new to assigned

Changed 5 weeks ago by anonymous

  • status changed from assigned to closed
  • resolution set to fixed

Changed 5 weeks ago by ebray

  • priority changed from highest to normal
  • status changed from closed to reopened
  • resolution fixed deleted
  • severity changed from blocker to normal

Undoing anonymous butchering. Setting priority and severity back to sane values--it's clear that the original issue in this ticket is due to notification problems. This isn't the only ticket addressing this problem either.

Changed 4 weeks ago by osimons

  • keywords pool added

Not really a notification problem, it is a db pool problem. But, as notifications may take a long time (and even longer with smtp errors), it may hog the connection for longer than expected - eventually exhausting the default process-wide pool of 10 connections and locking the process.

Hopefully improved by recent change [7537].

Add/Change #6219 (Error on trac setup on RHEL5 with sqllite)

Author



Change Properties
<Author field>
Action
as reopened
as The resolution will be set. Next status will be 'closed'
to The owner will change from anonymous. Next status will be 'new'
 
Note: See TracTickets for help on using tickets.