Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0039767
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] StoreServercriticalhave not tried2018-12-06 22:552018-12-10 09:58
ReportermtaalView Statuspublic 
Assigned Tomtaal 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision7678179d3b72
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToAugustoMauch
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0039767: Connection Leak in ServerStateBackground process

DescriptionSee attached screenshot, the thread which calls the servers to get the status uses separate threads [1]. If an exception occurs it will not release the connection it retrieved.

[1]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/tip/src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java#l454 [^]
Steps To ReproduceForce an error in the loop somewhere
Proposed SolutionAdd a rollback in a finally/exception block in the try-catch-finally here [1]

[1]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/tip/src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java#l454 [^]
TagsNo tags attached.
Attached Filesjpeg file icon WhatsApp Image 2018-12-06 at 19.00.03 (1).jpeg [^] (252,871 bytes) 2018-12-06 22:55


diff file icon 39767.diff [^] (802 bytes) 2018-12-09 14:08 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0108347)
mtaal (manager)
2018-12-09 14:04

Can be reproduced by forcing an error for example add this line
      // force NPE
      System.err.println(resp.toString());
in the pingServer method after the declaration of the resp variable.
(0108348)
hgbot (developer)
2018-12-09 22:05

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 7678179d3b72b5ad4fb73adf50b18218c147b053
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Dec 09 22:05:12 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/7678179d3b72b5ad4fb73adf50b18218c147b053 [^]

Fixes issue 39767: Connection Leak in ServerStateBackground process
Do rollback and close in case of error and ensure that commit and close is called last if no error

---
M src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java
---
(0108354)
AugustoMauch (manager)
2018-12-10 09:58

Code reviewed and verified.

The change itself makes sense, and it makes the code more robust against errors during the ping process.

Note though that the screenshot attached to the issue does not show a memory leak, just a slow execution of the process. Line printed at 12:53:02 states that the connection was returned to the pool.

- Issue History
Date Modified Username Field Change
2018-12-06 22:55 mtaal New Issue
2018-12-06 22:55 mtaal Assigned To => mtaal
2018-12-06 22:55 mtaal File Added: WhatsApp Image 2018-12-06 at 19.00.03 (1).jpeg
2018-12-06 22:55 mtaal Triggers an Emergency Pack => No
2018-12-09 14:04 mtaal Note Added: 0108347
2018-12-09 14:08 mtaal File Added: 39767.diff
2018-12-09 22:05 hgbot Checkin
2018-12-09 22:05 hgbot Note Added: 0108348
2018-12-09 22:05 hgbot Status new => resolved
2018-12-09 22:05 hgbot Resolution open => fixed
2018-12-09 22:05 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/7678179d3b72b5ad4fb73adf50b18218c147b053 [^]
2018-12-09 22:06 mtaal Review Assigned To => AugustoMauch
2018-12-10 09:58 AugustoMauch Note Added: 0108354
2018-12-10 09:58 AugustoMauch Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker