<feed xmlns='http://www.w3.org/2005/Atom'>
<title>unit.git/src/python, branch archive/unusedStructMember</title>
<subtitle>Universal Web Application Server</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/'/>
<entry>
<title>Removed special cases for non-NXT_CONF_VALUE_ARRAY.</title>
<updated>2022-04-26T10:38:48+00:00</updated>
<author>
<name>Alejandro Colomar</name>
<email>alx.manpages@gmail.com</email>
</author>
<published>2021-12-18T21:58:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=bce0f432c402ad18718aecab227b663160682ea4'/>
<id>bce0f432c402ad18718aecab227b663160682ea4</id>
<content type='text'>
The previous commit added more generic APIs for handling
NXT_CONF_VALUE_ARRAY and non-NXT_CONF_VALUE_ARRAY together.
Modify calling code to remove special cases for arrays and
non-arrays, taking special care that the path for non arrays is
logically equivalent to the previous special cased code.
Use the now-generic array code only.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The previous commit added more generic APIs for handling
NXT_CONF_VALUE_ARRAY and non-NXT_CONF_VALUE_ARRAY together.
Modify calling code to remove special cases for arrays and
non-arrays, taking special care that the path for non arrays is
logically equivalent to the previous special cased code.
Use the now-generic array code only.
</pre>
</div>
</content>
</entry>
<entry>
<title>Python: fixing debug message field type.</title>
<updated>2022-02-09T07:37:51+00:00</updated>
<author>
<name>Max Romanov</name>
<email>max.romanov@nginx.com</email>
</author>
<published>2022-02-09T07:37:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=bf6282b16ca192ace20b35711ed9b8a8014e63d4'/>
<id>bf6282b16ca192ace20b35711ed9b8a8014e63d4</id>
<content type='text'>
Introduced in the 78864c9d5ba8 commit.

Sorry about that.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduced in the 78864c9d5ba8 commit.

Sorry about that.
</pre>
</div>
</content>
</entry>
<entry>
<title>Python: fixing incorrect function object dereference.</title>
<updated>2022-02-08T09:04:41+00:00</updated>
<author>
<name>Max Romanov</name>
<email>max.romanov@nginx.com</email>
</author>
<published>2022-02-08T09:04:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=2b5941df74806d344c59ec0ca126b81cc7bbffe1'/>
<id>2b5941df74806d344c59ec0ca126b81cc7bbffe1</id>
<content type='text'>
The __call__ method can be native and not be a PyFunction type.  A type check
is thus required before accessing op_code and other fields.

Reproduced on Ubuntu 21.04, Python 3.9.4 and Falcon framework: here, the
App.__call__ method is compiled with Cython, so accessing op_code-&gt;co_flags is
invalid; accidentally, the COROUTINE bit is set which forces the Python module
into the ASGI mode.

The workaround is explicit protocol specification.

Note: it is impossible to specify the legacy mode for ASGI.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The __call__ method can be native and not be a PyFunction type.  A type check
is thus required before accessing op_code and other fields.

Reproduced on Ubuntu 21.04, Python 3.9.4 and Falcon framework: here, the
App.__call__ method is compiled with Cython, so accessing op_code-&gt;co_flags is
invalid; accidentally, the COROUTINE bit is set which forces the Python module
into the ASGI mode.

The workaround is explicit protocol specification.

Note: it is impossible to specify the legacy mode for ASGI.
</pre>
</div>
</content>
</entry>
<entry>
<title>Moving request limit control to libunit.</title>
<updated>2021-10-28T14:46:54+00:00</updated>
<author>
<name>Max Romanov</name>
<email>max.romanov@nginx.com</email>
</author>
<published>2021-10-28T14:46:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=bba97134e983541e94cf73e93900729e3a3e61fc'/>
<id>bba97134e983541e94cf73e93900729e3a3e61fc</id>
<content type='text'>
Introducting application graceful stop.  For now only used when application
process reach request limit value.

This closes #585 issue on GitHub.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introducting application graceful stop.  For now only used when application
process reach request limit value.

This closes #585 issue on GitHub.
</pre>
</div>
</content>
</entry>
<entry>
<title>Python: creating and reusing asgi_add_reader() wrapper.</title>
<updated>2021-10-28T14:46:52+00:00</updated>
<author>
<name>Max Romanov</name>
<email>max.romanov@nginx.com</email>
</author>
<published>2021-10-28T14:46:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=803e0373029a80994a85781d0b73b6cfa95bcf5a'/>
<id>803e0373029a80994a85781d0b73b6cfa95bcf5a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Python: fixing misprint in error message.</title>
<updated>2021-08-09T07:15:00+00:00</updated>
<author>
<name>Max Romanov</name>
<email>max.romanov@nginx.com</email>
</author>
<published>2021-08-09T07:15:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=3580842d34f8543f7bb41551f7a0dec8723289a8'/>
<id>3580842d34f8543f7bb41551f7a0dec8723289a8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Python: using default event_loop for main thread for ASGI.</title>
<updated>2021-07-20T07:37:54+00:00</updated>
<author>
<name>Max Romanov</name>
<email>max.romanov@nginx.com</email>
</author>
<published>2021-07-20T07:37:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=f27fbd9b4d2bdaddf1e7001d0d0bc5586ba04cd4'/>
<id>f27fbd9b4d2bdaddf1e7001d0d0bc5586ba04cd4</id>
<content type='text'>
Unit's ASGI implementation creates a new event loop to run an application for
each thread since 542b5b8c0647.  This may cause unexpected exceptions or
strange bugs if asyncio synchronisation primitives are initialised before the
application starts (e.g. globally).

Although the approach with a new event loop for the main thread is consistent
and helps to prepare the application to run in multiple threads, it can be a
source of pain for people who just want to run single-threaded ASGI
applications in Unit.

This is related to #560 issue on GitHub.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Unit's ASGI implementation creates a new event loop to run an application for
each thread since 542b5b8c0647.  This may cause unexpected exceptions or
strange bugs if asyncio synchronisation primitives are initialised before the
application starts (e.g. globally).

Although the approach with a new event loop for the main thread is consistent
and helps to prepare the application to run in multiple threads, it can be a
source of pain for people who just want to run single-threaded ASGI
applications in Unit.

This is related to #560 issue on GitHub.
</pre>
</div>
</content>
</entry>
<entry>
<title>Python: fixing exceptions in Future.set_result for ASGI implementation.</title>
<updated>2021-07-20T07:37:53+00:00</updated>
<author>
<name>Max Romanov</name>
<email>max.romanov@nginx.com</email>
</author>
<published>2021-07-20T07:37:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=dfbdc1c11a201e46d61f4bc61cfbe5741fc4fd70'/>
<id>dfbdc1c11a201e46d61f4bc61cfbe5741fc4fd70</id>
<content type='text'>
An ASGI application can cancel the Future object returned by the receive()
call.  In this case, Unit's ASGI implementation should not call set_result()
because the Future is already handled.  In particular, the Starlette framework
was noted to cancel the received Future.

This patch adds a done() check for the Future before attempting a set_result().

This is related to #564 issue on GitHub.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
An ASGI application can cancel the Future object returned by the receive()
call.  In this case, Unit's ASGI implementation should not call set_result()
because the Future is already handled.  In particular, the Starlette framework
was noted to cancel the received Future.

This patch adds a done() check for the Future before attempting a set_result().

This is related to #564 issue on GitHub.
</pre>
</div>
</content>
</entry>
<entry>
<title>Python: fixing ASGI receive() issues.</title>
<updated>2021-07-20T07:37:50+00:00</updated>
<author>
<name>Max Romanov</name>
<email>max.romanov@nginx.com</email>
</author>
<published>2021-07-20T07:37:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=567545213d95e608b54ce92bfc33fac4327a9f93'/>
<id>567545213d95e608b54ce92bfc33fac4327a9f93</id>
<content type='text'>
The receive() call never blocks for a GET request and always returns the same
empty body message.  The Starlette framework creates a separate task when
receive() is called in a loop until an 'http.disconnect' message is received.

The 'http.disconnect' message was previously issued after the response header
had been sent.  However, the correct behavior is to respond with
'http.disconnect' after sending the response is complete.

This closes #564 issue on GitHub.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The receive() call never blocks for a GET request and always returns the same
empty body message.  The Starlette framework creates a separate task when
receive() is called in a loop until an 'http.disconnect' message is received.

The 'http.disconnect' message was previously issued after the response header
had been sent.  However, the correct behavior is to respond with
'http.disconnect' after sending the response is complete.

This closes #564 issue on GitHub.
</pre>
</div>
</content>
</entry>
<entry>
<title>Python: support for multiple targets.</title>
<updated>2021-05-20T13:02:45+00:00</updated>
<author>
<name>Oisin Canty</name>
<email>o.canty@f5.com</email>
</author>
<published>2021-05-20T13:02:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=f60389a782470e31dc555ab864784b536f2544ca'/>
<id>f60389a782470e31dc555ab864784b536f2544ca</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
