dotCMS / dotCMS/core

DB connection leaks

Open
#35,119 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OKR : Customer Support stale
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Problem Statement

We are seeing some new leaking connections on startup which might be causing db deadlocks or other issues. Here is one example report:

java.lang.Exception: Apparent connection leak detected
	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:100)
	at com.dotmarketing.db.DbConnectionFactory.getConnection(DbConnectionFactory.java:253)
	at com.dotmarketing.common.db.DotConnect.executeQuery(DotConnect.java:625)
	at com.dotmarketing.common.db.DotConnect.loadResult(DotConnect.java:334)
	at com.dotmarketing.common.db.DotConnect.loadResults(DotConnect.java:456)
	at com.dotmarketing.servlets.UpdateQuartzCronJobsServlet.init(UpdateQuartzCronJobsServlet.java:48)
	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:986)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:943)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:840)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4222)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4523)
Steps to Reproduce

Start dotCMS , tail the logs

Acceptance Criteria
  • No more db leaks
dotCMS Version

26.03.20

Severity

Medium - Some functionality impacted

Links

https://dotcms.slack.com/archives/C096E0QAM7G/p1774457832731549

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue by starting dotCMS and tailing the logs. Trace the reported startup path through UpdateQuartzCronJobsServlet.init, DotConnect, and DbConnectionFactory, using the HikariDataSource stack trace as the guide. Done means the reported startup connection leaks no longer appear in the logs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.