ckan / ckan/ckanext-googleanalytics

httpd threads max out

Open
#12 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
36
Forks
84
PR merge metrics
No merged PRs in 30d

Description

Some recent change brought in this bug. We observed that after a fresh Apache start, the httpd process count will keep increasing, and max out after a few hours. At this point any new api call such as /api/3/action/package_search will cause 500 error with apache error:
`Error - : can't start new thread`

Here is the detailed error info.

```
...
Module ckanext.googleanalytics.controller:65 in __init__
<< t = AnalyticsPostThread(self.analytics_queue)
t.setDaemon(True)
t.start()

def _post_analytics(
>> t.start()
Module threading:474 in start
<< _active_limbo_lock.release()
try:
_start_new_thread(self.__bootstrap, ())
except Exception:
with _active_limbo_lock:
>> _start_new_thread(self.__bootstrap, ())
error: can't start new thread
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at ckanext.googleanalytics.controller line 65, where AnalyticsPostThread is created and started, and trace its lifecycle around _post_analytics. Reproduce the issue after a fresh Apache start while monitoring httpd process or thread counts, then exercise /api/3/action/package_search. Done means the thread count no longer grows without bound and the endpoint does not fail with “can't start new thread”.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
analytics, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.