Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SystemError exception when async_args PyTuple is reused. #1408 #1411

Merged
merged 1 commit into from
Dec 5, 2016
Merged

Fix SystemError exception when async_args PyTuple is reused. #1408 #1411

merged 1 commit into from
Dec 5, 2016

Conversation

a-feld
Copy link
Contributor

@a-feld a-feld commented Nov 29, 2016

In the case where the uwsgi_python_create_env_cheat env behavior is
used, the async_args PyTuple is reused on every request.

In some cases, the reference count on async_args may be > 1 at the end
of a request/response cycle. If PyTuple_SetItem is called with a
reference count > 1, a SystemError is raised.

When the cheat env behavior is used, the environ dictionary is also
reused between requests. This enables the elimination of redundant
PyTuple_SetItem calls by first checking to see if the environ dictionary
is already in the async_args tuple.

In the case where the uwsgi_python_create_env_cheat env behavior is
used, the async_args PyTuple is reused on every request.

In some cases, the reference count on async_args may be > 1 at the end
of a request/response cycle. If PyTuple_SetItem is called with a
reference count > 1, a SystemError is raised.

When the cheat env behavior is used, the environ dictionary is also
reused between requests. This enables the elimination of redundant
PyTuple_SetItem calls by first checking to see if the environ dictionary
is already in the async_args tuple.
@unbit unbit merged commit e61e3e6 into unbit:master Dec 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants