Description
Implement GET /v1/maintenance/_threads and GET /v1/maintenance/_threads/info in MaintenanceResource.java. The thread dump returns structured JSON (not HTML) for all JVM threads. The info endpoint returns lightweight system startup and thread count data.
Acceptance Criteria
GET /v1/maintenance/_threads
- API caller must receive a list of threads, each containing: name, id, daemon, priority, state, stackTrace (array of strings), lockedMonitors, lockedSynchronizers, lockInfo, lockOwnerName, lockOwnerId
- API caller must see deadlock detection — each thread must have a
deadlocked boolean flag based on ThreadMXBean.findDeadlockedThreads()
- API caller must be able to filter system threads via
hideSystem query param (default true) — when true, only threads with com.dotmarketing or com.dotcms in their stack traces are returned
- Response must include: timestamp, vmInfo (JVM name + version), threadCount, deadlockedCount
- Must require CMS Administrator role and Maintenance portlet access
GET /v1/maintenance/_threads/info
- API caller must receive: systemStartupTime (formatted string), startTimeMillis (epoch), uptimeMillis, currentThreadCount, peakThreadCount
- This is a lightweight call suitable for tab-load — no stack traces or heavy data
- Must require CMS Administrator role and Maintenance portlet access
Priority
None
Additional Context
- Thread data comes from
ManagementFactory.getThreadMXBean().dumpAllThreads(true, true) — the two true params request locked monitors and locked synchronizers
- Deadlock detection:
ThreadMXBean.findDeadlockedThreads() returns array of thread IDs (or null)
- Thread counts:
ThreadMXBean.getThreadCount() and getPeakThreadCount()
- Startup time:
ManagementFactory.getRuntimeMXBean().getStartTime()
- The DWR version uses reflection to get the internal
eetop field for native TID — this can be omitted, ThreadInfo.getThreadId() is sufficient
- DWR legacy:
ThreadMonitorTool.getThreads() lines 56–206, getSysProps() lines 228–242
- The JSP calls
getSysInfo() on page load (line 2000) and getAllThreads() on button click (line 1894) — they are intentionally separate for performance (info is lightweight, dump is heavy)
Description
Implement
GET /v1/maintenance/_threadsandGET /v1/maintenance/_threads/infoinMaintenanceResource.java. The thread dump returns structured JSON (not HTML) for all JVM threads. The info endpoint returns lightweight system startup and thread count data.Acceptance Criteria
GET /v1/maintenance/_threads
deadlockedboolean flag based onThreadMXBean.findDeadlockedThreads()hideSystemquery param (default true) — when true, only threads withcom.dotmarketingorcom.dotcmsin their stack traces are returnedGET /v1/maintenance/_threads/info
Priority
None
Additional Context
ManagementFactory.getThreadMXBean().dumpAllThreads(true, true)— the twotrueparams request locked monitors and locked synchronizersThreadMXBean.findDeadlockedThreads()returns array of thread IDs (or null)ThreadMXBean.getThreadCount()andgetPeakThreadCount()ManagementFactory.getRuntimeMXBean().getStartTime()eetopfield for native TID — this can be omitted,ThreadInfo.getThreadId()is sufficientThreadMonitorTool.getThreads()lines 56–206,getSysProps()lines 228–242getSysInfo()on page load (line 2000) andgetAllThreads()on button click (line 1894) — they are intentionally separate for performance (info is lightweight, dump is heavy)