<feed xmlns='http://www.w3.org/2005/Atom'>
<title>unit.git/src, branch 1.13.0-1</title>
<subtitle>Universal Web Application Server</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/'/>
<entry>
<title>Python: avoiding buffering of exception backtraces.</title>
<updated>2019-11-14T14:48:48+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2019-11-14T14:48:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=c2976fb3378b015b7c70247e0d462c1b52214458'/>
<id>c2976fb3378b015b7c70247e0d462c1b52214458</id>
<content type='text'>
A quote from the Python 3 documentation:

 | When interactive, stdout and stderr streams are line-buffered.
 | Otherwise, they are block-buffered like regular text files.

As a result, if an exception occurred and PyErr_Print() was called, its output
could be buffered but not printed to the log for a while (ultimately, until
the interpreter finalization).  If the application process crashed shortly,
the backtrace was completely lost.

Buffering can be disabled by redefining the sys.stderr stream object.
However, interference with standard environment objects was deemed undesirable.
Instead, sys.stderr.flush() is called every time after printing exceptions.
A potential advantage here is that lines from backtraces won't be mixed
with other lines in the log.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A quote from the Python 3 documentation:

 | When interactive, stdout and stderr streams are line-buffered.
 | Otherwise, they are block-buffered like regular text files.

As a result, if an exception occurred and PyErr_Print() was called, its output
could be buffered but not printed to the log for a while (ultimately, until
the interpreter finalization).  If the application process crashed shortly,
the backtrace was completely lost.

Buffering can be disabled by redefining the sys.stderr stream object.
However, interference with standard environment objects was deemed undesirable.
Instead, sys.stderr.flush() is called every time after printing exceptions.
A potential advantage here is that lines from backtraces won't be mixed
with other lines in the log.
</pre>
</div>
</content>
</entry>
<entry>
<title>Python: removed wrong PyErr_Print() call.</title>
<updated>2019-11-14T14:48:48+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2019-11-14T14:48:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=4e41d900064bcccc02ec7efd0109c190d6637028'/>
<id>4e41d900064bcccc02ec7efd0109c190d6637028</id>
<content type='text'>
PyCallable_Check() doesn't produce errors.

The needless call was introduced in fdd6ed28e3b9.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PyCallable_Check() doesn't produce errors.

The needless call was introduced in fdd6ed28e3b9.
</pre>
</div>
</content>
</entry>
<entry>
<title>Python: optimized response object close() calling.</title>
<updated>2019-11-14T14:48:48+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2019-11-14T14:48:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=b3db7a30c0c248616945926e1692e0601d0bbec6'/>
<id>b3db7a30c0c248616945926e1692e0601d0bbec6</id>
<content type='text'>
PyObject_HasAttrString() is just a wrapper over PyObject_GetAttrString(),
while PyObject_CallMethod() calls it as the first step.  As a result,
PyObject_GetAttrString() was called twice if close() was present.

To get rid of PyObject_HasAttrString() while keeping the same behaviour,
the PyObject_CallMethod() call has been decomposed into separate calls of
PyObject_GetAttrString() and PyObject_CallFunction().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PyObject_HasAttrString() is just a wrapper over PyObject_GetAttrString(),
while PyObject_CallMethod() calls it as the first step.  As a result,
PyObject_GetAttrString() was called twice if close() was present.

To get rid of PyObject_HasAttrString() while keeping the same behaviour,
the PyObject_CallMethod() call has been decomposed into separate calls of
PyObject_GetAttrString() and PyObject_CallFunction().
</pre>
</div>
</content>
</entry>
<entry>
<title>Python: fixed an object leak when response close() is called.</title>
<updated>2019-11-14T14:48:48+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2019-11-14T14:48:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=75c2c23bb6cd95a9e08d89f74e6457321d266ed2'/>
<id>75c2c23bb6cd95a9e08d89f74e6457321d266ed2</id>
<content type='text'>
On success, PyObject_CallMethod() returns a new reference to
the result of the call, which previously got lost.

Also, error logging on failure was added.

The issue was introduced by b0148ec28c4d.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On success, PyObject_CallMethod() returns a new reference to
the result of the call, which previously got lost.

Also, error logging on failure was added.

The issue was introduced by b0148ec28c4d.
</pre>
</div>
</content>
</entry>
<entry>
<title>Python: refactored nxt_python_request_handler().</title>
<updated>2019-11-14T14:48:48+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2019-11-14T14:48:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=c667bb446d866f1a1a786fa9a3b3ecd06d163cfb'/>
<id>c667bb446d866f1a1a786fa9a3b3ecd06d163cfb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Python: fixed potential object leak in case of allocation error.</title>
<updated>2019-11-14T14:48:48+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2019-11-14T14:48:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=cd6cb02be08906e28738d62485cdc3d9d75592bb'/>
<id>cd6cb02be08906e28738d62485cdc3d9d75592bb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Python: improved error handling if response object isn't iterable.</title>
<updated>2019-11-14T14:48:48+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2019-11-14T14:48:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=e9429324c218942ba05fa586cd139c81a94e2b66'/>
<id>e9429324c218942ba05fa586cd139c81a94e2b66</id>
<content type='text'>
According to the documentation, PyObject_GetIter():

 | Raises TypeError and returns NULL if the object cannot be iterated.

Previously, this exception wasn't printed or cleared and remained unhandled.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to the documentation, PyObject_GetIter():

 | Raises TypeError and returns NULL if the object cannot be iterated.

Previously, this exception wasn't printed or cleared and remained unhandled.
</pre>
</div>
</content>
</entry>
<entry>
<title>Python: fixed handling of errors on response object iteration.</title>
<updated>2019-11-14T14:48:48+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2019-11-14T14:48:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=e189d0a96c4020adca73f8fcff04255b6c9a1c5a'/>
<id>e189d0a96c4020adca73f8fcff04255b6c9a1c5a</id>
<content type='text'>
According to the documentation, PyIter_Next():

 | If there are no remaining values, returns NULL with no exception set.
 | If an error occurs while retrieving the item, returns NULL and passes
 | along the exception.

Previously, this exception wasn't properly handled and the response was
finalized as successful.

This issue was introduced in b0148ec28c4d.

A check for PyErr_Occurred() located in the code below might print this
traceback or occasionally catch an exception from one of the two response
close() calls.

Albeit that exceptions from the close() calls also need to be catched,
it's clear that this particular check wasn't supposed to do so.  This is
another issue and it will be fixed later.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to the documentation, PyIter_Next():

 | If there are no remaining values, returns NULL with no exception set.
 | If an error occurs while retrieving the item, returns NULL and passes
 | along the exception.

Previously, this exception wasn't properly handled and the response was
finalized as successful.

This issue was introduced in b0148ec28c4d.

A check for PyErr_Occurred() located in the code below might print this
traceback or occasionally catch an exception from one of the two response
close() calls.

Albeit that exceptions from the close() calls also need to be catched,
it's clear that this particular check wasn't supposed to do so.  This is
another issue and it will be fixed later.
</pre>
</div>
</content>
</entry>
<entry>
<title>Processing inconsistent proxied response length.</title>
<updated>2019-11-14T13:40:02+00:00</updated>
<author>
<name>Igor Sysoev</name>
<email>igor@sysoev.ru</email>
</author>
<published>2019-11-14T13:40:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=02e197e9782ca19bd668c37c11f529f802823868'/>
<id>02e197e9782ca19bd668c37c11f529f802823868</id>
<content type='text'>
Keepalive connection is disabled if upstream response length
differs from specified in the "Content-Length" field value.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Keepalive connection is disabled if upstream response length
differs from specified in the "Content-Length" field value.
</pre>
</div>
</content>
</entry>
<entry>
<title>Initial proxy support.</title>
<updated>2019-11-14T13:39:54+00:00</updated>
<author>
<name>Igor Sysoev</name>
<email>igor@sysoev.ru</email>
</author>
<published>2019-11-14T13:39:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=ddde9c23cf302309d85ccc24b35075ce94da89a0'/>
<id>ddde9c23cf302309d85ccc24b35075ce94da89a0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
