Opened 4 years ago

Closed 3 years ago

#713 closed defect (fixed)

petascope doesn't close database connections

Reported by: dmisev Owned by: dmisev
Priority: minor Milestone: 9.0.x
Component: petascope Version: development
Keywords: Cc: arezaeim
Complexity: Medium

Description

$ ps aux | grep petas
postgres  9952  0.0  0.1 1168884 7472 ?        Ss   Mar19   0:00 postgres: petauser petascopedb 127.0.0.1(20351) idle in transaction                                      
postgres 16809  0.0  0.1 1169028 9036 ?        Ss   Mar19   0:00 postgres: petauser petascopedb 127.0.0.1(33828) idle in transaction                                      
postgres 30223  0.0  0.1 1189268 11472 ?       Ss   Mar19   0:00 postgres: petauser petascopedb 127.0.0.1(52554) idle in transaction 

This is more of an annoyance, nothing critical, we just need to check if connections indeed need to stay open after a request is finished.

Change History (3)

comment:1 Changed 3 years ago by dmisev

  • Owner changed from pcampalani to dmisev
  • Status changed from new to assigned

As far as I can see there's a connection leak, the connection is not closed in many places.

comment:2 Changed 3 years ago by dmisev

  • Cc arezaeim added

DbMetadataSource.executePostGISQuery and DbMetadataSource.readDescription need to be checked as they don't seem to close !Statement and ResultSet objects.

I submitted patch to fix the connection leak by opening and closing the connection at every request. Next step is to have connection pooling.

comment:3 Changed 3 years ago by dmisev

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.