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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0039362
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] A. Platformmajorrandom2018-09-27 14:522018-12-11 20:22
ReporteralostaleView Statuspublic 
Assigned Toalostale 
PrioritynormalResolutionfixedFixed in Version3.0PR19Q1
StatusclosedFix in branchFixed in SCM revisiond8c618c02470
ProjectionnoneETAnoneTarget Version3.0PR19Q1
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToAugustoMauch
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0039362: if ticket fails to be created due to no DB connections, no more tickets can be created from same terminal

DescriptionAs per design when a ticket creation fails at infrastructure level, the system will not allow to create any new ticket from the same terminal until the problem is fixed. Subsequent tickets from that are marked as error in "Data Import Entries".

The most common problem detected as infrastructural is running out of database connections. Although this situation is temporary and it gets automatically fixed when pressure in DB decreases, if there are tickets being processed in a moment where there are no connections to process but there is at least a connection to mark the ticket as error, it will be marked. Afterwards no tickets from that terminal will be created till errors are marked back as initial status.
Steps To ReproduceBecause it only happens under some race conditions, it cannot be easily reproduced. We can emulate these conditions as follows:

  1. Apply patch consume-all-connections.diff
  2. Set breakpoints to manually synchronize actions, in (line numbers from pi@fabe6e99f181):
       * About - line 60. Just when we exhausted the pool
       * ImportEntryProcessor - line 330. Start of doRunCycle
       * ImportEntryProcessor - line 441. Start of main catch block
  3. In WebPOS create a ticket
     -> It will stop in ImportEntryProcessor 330
  4. In backoffice open About popup
     -> It will consume all avaiable connections and stop in breakpoint
  5. Resume thread stopped in 3 keeping stopped the one in About
     -> It will fail and stop in ImportEntryProcessor 441
  6. Resume thread in About
     -> Connections are released
  7. Resume thread in ImportEntryProcessor
     -> The entry is marked as error
  8. Create more tickets from same terminal (no need of any breakpoint)
     -> Check: all these new tickets are set in error in Data Import Entries window

Note pool cat get exhausted because of reaching pool limit or by reaching limit of physical DB connections, in latter case exception is dbms specific.
Proposed SolutionThe case of running out of connections should be handled as special:
- When it is detected, the ticket is left in Initial status instead of setting it in Error.
- If there are more tickets to be processed in the same cycle, none will be tried to be processed.
- Next cycle execution will pick all the tickets that were not processed and, if there are available connections, all will be processed.

In this way the problem will not be automatically fixed when instead of exposing to the end user.


TagsNo tags attached.
Attached Filesdiff file icon consume-all-connections.diff [^] (1,564 bytes) 2018-09-27 15:24 [Show Content]
? file icon 39362.export [^] (6,043 bytes) 2018-09-28 08:06

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0107059)
alostale (developer)
2018-09-28 08:06

attached proposed solution
(0107151)
hgbot (developer)
2018-10-04 09:22

Repository: erp/devel/pi
Changeset: d8c618c024703178e87d4b172b3f0fc34a6549f5
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Sep 28 08:03:08 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d8c618c024703178e87d4b172b3f0fc34a6549f5 [^]

fixed issue 39362: can't create tickets if one failed due to pool without conns

  After a ticket failed to be imported due to the pool is out of connections, no
  new tickets can be created from that terminal until all import entries are set
  again in Initial status.

  Now in this case instead of setting the import entry as Error preventing new
  tickets from the same terminal to be processed, it's kept in Initial status,
  in this way it will be tried to be processed in next cycle, not exposing the
  problem to users.

---
M modules/org.openbravo.apachejdbcconnectionpool/src/org/openbravo/apachejdbcconnectionpool/JdbcExternalConnectionPool.java
M src-core/src/org/openbravo/database/ExternalConnectionPool.java
M src/org/openbravo/service/importprocess/ImportEntryProcessor.java
---
(0107152)
hgbot (developer)
2018-10-04 09:22

Repository: erp/devel/pi
Changeset: ba9ef09516cf6e6bddb220691a55bdc720244463
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Oct 02 09:43:11 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/ba9ef09516cf6e6bddb220691a55bdc720244463 [^]

related to issue 39362: added test cases covering no DB conns detection

---
M src-test/src/org/openbravo/test/AllAntTaskTests.java
A src-test/src/org/openbravo/test/db/pool/PoolHasNoConnectionsDetection.java
---
(0107378)
AugustoMauch (developer)
2018-10-17 18:24

Code reviewed and verified
(0108418)
hudsonbot (developer)
2018-12-11 20:22

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/470e3cd384c5 [^]
Maturity status: Test
(0108419)
hudsonbot (developer)
2018-12-11 20:22

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/470e3cd384c5 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2018-09-27 14:52 alostale New Issue
2018-09-27 14:52 alostale Assigned To => alostale
2018-09-27 14:52 alostale Modules => Core
2018-09-27 14:52 alostale Triggers an Emergency Pack => No
2018-09-27 14:57 alostale Steps to Reproduce Updated View Revisions
2018-09-27 14:57 alostale Steps to Reproduce Updated View Revisions
2018-09-27 15:24 alostale File Added: consume-all-connections.diff
2018-09-27 15:57 alostale Steps to Reproduce Updated View Revisions
2018-09-27 15:57 alostale Proposed Solution updated
2018-09-28 08:06 alostale File Added: 39362.export
2018-09-28 08:06 alostale Note Added: 0107059
2018-09-28 08:12 alostale Status new => scheduled
2018-09-28 08:16 alostale Review Assigned To => AugustoMauch
2018-09-28 08:17 alostale Target Version => 3.0PR19Q1
2018-10-04 09:22 hgbot Checkin
2018-10-04 09:22 hgbot Note Added: 0107151
2018-10-04 09:22 hgbot Status scheduled => resolved
2018-10-04 09:22 hgbot Resolution open => fixed
2018-10-04 09:22 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d8c618c024703178e87d4b172b3f0fc34a6549f5 [^]
2018-10-04 09:22 hgbot Checkin
2018-10-04 09:22 hgbot Note Added: 0107152
2018-10-17 18:24 AugustoMauch Note Added: 0107378
2018-10-17 18:24 AugustoMauch Status resolved => closed
2018-10-17 18:24 AugustoMauch Fixed in Version => 3.0PR19Q1
2018-12-11 20:22 hudsonbot Checkin
2018-12-11 20:22 hudsonbot Note Added: 0108418
2018-12-11 20:22 hudsonbot Checkin
2018-12-11 20:22 hudsonbot Note Added: 0108419


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker