Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
feat: upgrade to pypy6 for debug symbols
Browse files Browse the repository at this point in the history
and include its new gc.get_stats in memusage

Closes #1288
  • Loading branch information
pjenvey committed Aug 27, 2018
1 parent 6e0452c commit b4d5e73
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,4 +1,4 @@
FROM pypy:2-5.9.0
FROM pypy:2-6.0.0

RUN mkdir -p /app
ADD . /app
Expand Down
2 changes: 2 additions & 0 deletions autopush/memusage.py
Expand Up @@ -41,6 +41,8 @@ def trap_err(func, *args, **kwargs):
trap_err(pmap_extended, buf)
trap_err(jemalloc_stats, buf)
trap_err(glibc_malloc_info, buf)
if hasattr(gc, 'get_stats'):
buf.writelines(['\n\n', gc.get_stats(), '\n\n'])
if do_dump_rpy_heap:
# dump rpython's heap before objgraph potentially pollutes the
# heap with its heavy workload
Expand Down
2 changes: 1 addition & 1 deletion autopush/router/gcm.py
Expand Up @@ -139,7 +139,7 @@ def _route(self, notification, uaid_data):
self._base_tags,
reason="timeout"))
raise RouterException("Server error", status_code=502,
errno=902,
errno=903,
log_exception=False)
except Exception as e:
self.log.error("Unhandled exception in GCM Routing: %s" % e)
Expand Down
2 changes: 2 additions & 0 deletions autopush/tests/test_integration.py
Expand Up @@ -2190,6 +2190,8 @@ def test_memusage(self):
assert 'size: ' in body
assert 'rpy_unicode' in body
assert 'get_stats_asmmemmgr: (' in body
if sys.pypy_version_info.major >= 6:
assert 'Total memory allocated:' in body

@inlineCallbacks
def test_memusage_options(self):
Expand Down
7 changes: 7 additions & 0 deletions docs/http.rst
Expand Up @@ -129,6 +129,13 @@ Unless otherwise specified, all calls return one the following error statuses:

- errno 999 - Unknown error

- 502 - **Bad Gateway** - The Push Service received an invalid response from an upstream Bridge service.

- errno 900 - Internal Bridge misconfiguration
- errno 901 - Invalid authentication
- errno 902 - An error occurred while establishing a connection
- errno 903 - The request timed out

- 503 - **Server temporarily unavaliable.** - The Push Service is currently unavailable. See the error number "errno" value to see if retries are available.

- errno 201 - Use exponential back-off for retries
Expand Down

0 comments on commit b4d5e73

Please sign in to comment.