[MAGNOLIA-7808] H2-Startup extremely slow on Windows & Ubuntu (when more than one NIC existing): AUTO_SERVER=TRUE Created: 25/May/20  Updated: 16/Dec/21  Resolved: 16/Dec/21

Status: Closed
Project: Magnolia
Component/s: bundle
Affects Version/s: 6.1.1, 6.1.2, 6.1.3, 6.1.4, 6.1.5, 6.2, 6.2.1, 6.2.2
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Christian Ringele Assignee: Unassigned
Resolution: Won't Fix Votes: 2
Labels: support, y2k
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows & Ubuntu local startup using H2-PM and having more than one NIC.


Issue Links:
Relates
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

Situation:

  • Using H2 PM on Windows (or Ubuntu) AND having more than one NIC
  • H2-PM is configured using the value 'AUTO_SERVER=FALSE' in:
    WEB-INF/config/repo-conf/jackrabbit-bundle-h2-search.xml
<PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.H2PersistenceManager">
      <param name="url" value="jdbc:h2:${rep.home}/version/db;AUTO_SERVER=FALSE" />
      <param name="schemaObjectPrefix" value="version_" />
    </PersistenceManager>

Problem:

Startup when reading the H2 data it takes around 5-10 minutes (!!) to load all workspaces.

Root couse:

http://www.h2database.com/html/features.html -> Automatic Mixed Mode

The 'Automatic Mixed Mode' opens a port and would allow multiple connections into the PM/DB.
This seems to cause severe problems on Windows when having more than one NIC on the machine, for example when being plugged into a docking-station.

It seems that on any file access/change in the H2-FS it waits for a time out of the second NIC which doesn't serve any response as no tomcat is running/responding on it.

Solution:

  • Set the value to 'AUTO_SERVER=FALSE' before first deployment. Otherwise this value is persisted in each workspace.xml.
  • Magnolia should set that value in our webapp and bundle to 'AUTO_SERVER=FALSE'


 Comments   
Comment by Simon Lutz [ 16/Dec/21 ]

Closing; we do not recommend to use H2 in production.

Workaround:

  • Set the value to 'AUTO_SERVER=FALSE' before first deployment. Otherwise this value is persisted in each workspace.xml.
Generated at Mon Feb 12 04:27:01 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.