Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
0f2279d3
Commit
0f2279d3
authored
Jul 25, 2017
by
Eric Fischer
Committed by
GitHub
Jul 25, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15658 from edx/efischer/fix_leaks
CMS memory leak fix
parents
228356dc
d4943c53
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
20 deletions
+8
-20
cms/djangoapps/contentstore/tests/test_course_listing.py
+1
-1
common/lib/xmodule/xmodule/modulestore/__init__.py
+1
-14
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
+2
-1
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
+2
-2
lms/djangoapps/django_comment_client/base/tests.py
+2
-2
No files found.
cms/djangoapps/contentstore/tests/test_course_listing.py
View file @
0f2279d3
...
@@ -318,7 +318,7 @@ class TestCourseListing(ModuleStoreTestCase, XssTestMixin):
...
@@ -318,7 +318,7 @@ class TestCourseListing(ModuleStoreTestCase, XssTestMixin):
)
)
@ddt.data
(
@ddt.data
(
(
ModuleStoreEnum
.
Type
.
split
,
3
,
1
3
),
(
ModuleStoreEnum
.
Type
.
split
,
4
,
2
3
),
(
ModuleStoreEnum
.
Type
.
mongo
,
USER_COURSES_COUNT
,
2
)
(
ModuleStoreEnum
.
Type
.
mongo
,
USER_COURSES_COUNT
,
2
)
)
)
@ddt.unpack
@ddt.unpack
...
...
common/lib/xmodule/xmodule/modulestore/__init__.py
View file @
0f2279d3
...
@@ -7,7 +7,6 @@ import logging
...
@@ -7,7 +7,6 @@ import logging
import
re
import
re
import
json
import
json
import
datetime
import
datetime
import
traceback
from
pytz
import
UTC
from
pytz
import
UTC
from
collections
import
defaultdict
from
collections
import
defaultdict
...
@@ -158,19 +157,7 @@ class ActiveBulkThread(threading.local):
...
@@ -158,19 +157,7 @@ class ActiveBulkThread(threading.local):
"""
"""
def
__init__
(
self
,
bulk_ops_record_type
,
**
kwargs
):
def
__init__
(
self
,
bulk_ops_record_type
,
**
kwargs
):
super
(
ActiveBulkThread
,
self
)
.
__init__
(
**
kwargs
)
super
(
ActiveBulkThread
,
self
)
.
__init__
(
**
kwargs
)
self
.
_records
=
defaultdict
(
bulk_ops_record_type
)
self
.
records
=
defaultdict
(
bulk_ops_record_type
)
self
.
CMS_LEAK_DEBUG_GLOBAL
=
True
# only log once per process
@property
def
records
(
self
):
if
self
.
CMS_LEAK_DEBUG_GLOBAL
and
len
(
self
.
_records
)
>
2000
:
# arbitrary limit, we peak around ~2750 on edx.org
log
.
info
(
"EDUCATOR-768: The memory leak issue may be in progress. How we got here:
\n
{}"
.
format
(
""
.
join
(
traceback
.
format_stack
())
)
)
self
.
CMS_LEAK_DEBUG_GLOBAL
=
False
return
self
.
_records
class
BulkOperationsMixin
(
object
):
class
BulkOperationsMixin
(
object
):
...
...
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
View file @
0f2279d3
...
@@ -788,7 +788,8 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
...
@@ -788,7 +788,8 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
if
should_cache_items
:
if
should_cache_items
:
self
.
cache_items
(
runtime
,
block_keys
,
course_entry
.
course_key
,
depth
,
lazy
)
self
.
cache_items
(
runtime
,
block_keys
,
course_entry
.
course_key
,
depth
,
lazy
)
return
[
runtime
.
load_item
(
block_key
,
course_entry
,
**
kwargs
)
for
block_key
in
block_keys
]
with
self
.
bulk_operations
(
course_entry
.
course_key
,
emit_signals
=
False
):
return
[
runtime
.
load_item
(
block_key
,
course_entry
,
**
kwargs
)
for
block_key
in
block_keys
]
def
_get_cache
(
self
,
course_version_guid
):
def
_get_cache
(
self
,
course_version_guid
):
"""
"""
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
View file @
0f2279d3
...
@@ -418,7 +418,7 @@ class TestMixedModuleStore(CommonMixedModuleStoreSetup):
...
@@ -418,7 +418,7 @@ class TestMixedModuleStore(CommonMixedModuleStoreSetup):
# wildcard query, 6! load pertinent items for inheritance calls, load parents, course root fetch (why)
# wildcard query, 6! load pertinent items for inheritance calls, load parents, course root fetch (why)
# Split:
# Split:
# active_versions (with regex), structure, and spurious active_versions refetch
# active_versions (with regex), structure, and spurious active_versions refetch
@ddt.data
((
ModuleStoreEnum
.
Type
.
mongo
,
14
,
0
),
(
ModuleStoreEnum
.
Type
.
split
,
3
,
0
))
@ddt.data
((
ModuleStoreEnum
.
Type
.
mongo
,
14
,
0
),
(
ModuleStoreEnum
.
Type
.
split
,
4
,
0
))
@ddt.unpack
@ddt.unpack
def
test_get_items
(
self
,
default_ms
,
max_find
,
max_send
):
def
test_get_items
(
self
,
default_ms
,
max_find
,
max_send
):
self
.
initdb
(
default_ms
)
self
.
initdb
(
default_ms
)
...
@@ -1043,7 +1043,7 @@ class TestMixedModuleStore(CommonMixedModuleStoreSetup):
...
@@ -1043,7 +1043,7 @@ class TestMixedModuleStore(CommonMixedModuleStoreSetup):
# 1) wildcard split search,
# 1) wildcard split search,
# 2-4) active_versions, structure, definition (s/b lazy; so, unnecessary)
# 2-4) active_versions, structure, definition (s/b lazy; so, unnecessary)
# 5) wildcard draft mongo which has none
# 5) wildcard draft mongo which has none
@ddt.data
((
ModuleStoreEnum
.
Type
.
mongo
,
3
,
0
),
(
ModuleStoreEnum
.
Type
.
split
,
5
,
0
))
@ddt.data
((
ModuleStoreEnum
.
Type
.
mongo
,
3
,
0
),
(
ModuleStoreEnum
.
Type
.
split
,
6
,
0
))
@ddt.unpack
@ddt.unpack
def
test_get_courses
(
self
,
default_ms
,
max_find
,
max_send
):
def
test_get_courses
(
self
,
default_ms
,
max_find
,
max_send
):
self
.
initdb
(
default_ms
)
self
.
initdb
(
default_ms
)
...
...
lms/djangoapps/django_comment_client/base/tests.py
View file @
0f2279d3
...
@@ -405,7 +405,7 @@ class ViewsQueryCountTestCase(
...
@@ -405,7 +405,7 @@ class ViewsQueryCountTestCase(
@ddt.data
(
@ddt.data
(
(
ModuleStoreEnum
.
Type
.
mongo
,
3
,
4
,
31
),
(
ModuleStoreEnum
.
Type
.
mongo
,
3
,
4
,
31
),
(
ModuleStoreEnum
.
Type
.
split
,
3
,
1
2
,
31
),
(
ModuleStoreEnum
.
Type
.
split
,
3
,
1
3
,
31
),
)
)
@ddt.unpack
@ddt.unpack
@count_queries
@count_queries
...
@@ -414,7 +414,7 @@ class ViewsQueryCountTestCase(
...
@@ -414,7 +414,7 @@ class ViewsQueryCountTestCase(
@ddt.data
(
@ddt.data
(
(
ModuleStoreEnum
.
Type
.
mongo
,
3
,
3
,
27
),
(
ModuleStoreEnum
.
Type
.
mongo
,
3
,
3
,
27
),
(
ModuleStoreEnum
.
Type
.
split
,
3
,
9
,
27
),
(
ModuleStoreEnum
.
Type
.
split
,
3
,
10
,
27
),
)
)
@ddt.unpack
@ddt.unpack
@count_queries
@count_queries
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment