Aymeric Augustin added the comment:
Would it make sense to add `await asyncio.sleep(0)` in `Server.wait_closed()`
to ensure that all connections reach `connection_made()` before `wait_closed()`
returns?
This would be fragile but it would be an improvement over the current behavior
Aymeric Augustin added the comment:
websockets doesn't use threads (except where asyncio uses them under the hood
e.g. for resolving addresses).
Perhaps the OP's code passes asyncio connections (wrapped in websocket
connections) unsafely across threads.
--
nosy: +aymeri
Aymeric Augustin added the comment:
The same issue was reported in the bug tracker for websockets:
https://github.com/aaugustin/websockets/issues/614
--
nosy: +aymeric.augustin
___
Python tracker
<https://bugs.python.org/issue34
Aymeric Augustin added the comment:
Yes, that seems reasonable.
--
___
Python tracker
<https://bugs.python.org/issue34506>
___
___
Python-bugs-list mailin
New submission from Aymeric Augustin :
`StreamReaderProtocol` was a public API from Python 3.4 to 3.6:
-
https://docs.python.org/3.4/library/asyncio-stream.html?highlight=streamreaderprotocol#streamreaderprotocol
-
https://docs.python.org/3.5/library/asyncio-stream.html?highlight
Change by Aymeric Augustin :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue37639>
___
___
Python-bugs-list
Aymeric Augustin added the comment:
I worked around this bug in websockets by serializing access to `drain()` with
a lock:
https://github.com/aaugustin/websockets/commit/198b71537917adb44002573b14cbe23dbd4c21a2
I suspect this is inefficient but it beats crashing
New submission from Aymeric Augustin:
asyncio.StreamWriter wraps a transport. The first three document methods of
asyncio.BaseTransport are close(), is_closing() and get_extra_info().
It is somewhat surprising that StreamWriter provides close() and
get_extra_info() but not is_closing(). I
Aymeric Augustin added the comment:
For context, websockets calls `yield from self.writer.drain()` after each write
in order to provide backpressure.
If the output buffer fills up, calling API coroutines that write to the
websocket connection becomes slow and hopefully the backpressure will
Aymeric Augustin added the comment:
drain() returns when the write buffer reaches the low water mark, not when it's
empty, so you don't have a guarantee that your bytes were written to the socket.
https://github.com/python/cpython/blob/6f0eb93183519024cb360162bdd81b9faec97ba6/L
Aymeric Augustin added the comment:
A very similar issue came up here:
https://github.com/aaugustin/websockets/issues/593
When raising an exception that gathers multiple sub-exceptions, it would be
nice to be able to iterate the exception to access the sub-exceptions.
--
nosy
Aymeric Augustin added the comment:
I believe this is by design: the documentation says:
> The sockets that represent existing incoming client connections are left open.
`Server` doesn't keep track of active transports serving requests.
(That said, I haven't figured out wha
New submission from Aymeric Augustin :
**Summary**
1. Is it correct for `Server.wait_closed()` (as implemented in asyncio) to be a
no-op after `Server.close()`?
2. How can I tell that all incoming connections have been received by
`connection_made()` after `Server.close()`?
**Details
Aymeric Augustin added the comment:
For now I will use the following hack:
server.close()
await server.wait_closed()
# Workaround for wait_closed() not quite doing
# what I want.
await asyncio.sleep(0)
# I believe that all accepted connections have reached
Aymeric Augustin added the comment:
I'm attaching a documentation patch describing improvements of the transaction
management APIs that would address this issue as well as three others.
It's preserving the current transaction handling by default for backwards
compatibility. It
Aymeric Augustin added the comment:
Thanks for your feedback!
Indeed this is a documentation patch describing what I could implement if a
core dev gave the slightest hint that it stands a small chance of getting
included. There's no point in writing code that Python core doesn'
Aymeric Augustin added the comment:
The problem is super simple:
connection = ...
cursor = connection.cursor()
cursor.execute("SAVEPOINT foo")
cursor.execute("ROLLBACK TO SAVEPOINT foo") # will report that the savepoint
doesn't exist.
Please don't make it lo
Aymeric Augustin added the comment:
> The idea was to not take away from what's there already: The sqlite3 module
> already has a feature to inspect a command and begin or commit automatically.
> Just stripping that away *removes* a feature that has been available for a
&g
Aymeric Augustin added the comment:
> If this statement is accurate, the what you are proposing is just a different
> (presumably clearer) spelling for 'isolation_level = None'?
This statement is accurate but it doesn't cover the whole scope of what I'm
attempting t
Aymeric Augustin added the comment:
Jim, I believe this API decision doesn't affect the patch in a major way.
I'll write the rest of the patch and the committer who reviews it will decide.
--
___
Python tracker
<http://bugs.python.o
New submission from Aymeric Augustin:
https://docs.python.org/3/library/asyncio-stream.html?highlight=streamreaderprotocol#stream-functions
says:
> (If you want to customize the StreamReader and/or StreamReaderProtocol
> classes, just copy the code – there’s really nothing special here
Aymeric Augustin added the comment:
This bug appears to be fixed upstream:
https://github.com/ghaering/pysqlite/commit/f254c534948c41c0ceb8cbabf0d4a2f547754739
--
___
Python tracker
<http://bugs.python.org/issue10
Aymeric Augustin added the comment:
Since a better solution seems to be around the corner, I'm withdrawing my
proposal.
I'm attaching the current state of my patch. It isn't functional. Mostly it
proves that my API proposal is very inconvenient to implement in C. That's w
Aymeric Augustin added the comment:
This change appears to have caused a non-obvious regression in `websockets`:
https://github.com/aaugustin/websockets/issues/76
Perhaps I was relying on an implementation detail but that's annoying
nonetheless.
--
nosy: +aymeric.aug
Aymeric Augustin added the comment:
martin.panter: of course, I'm fine with integrating that code into Python.
deronnax: could you create a ticket on https://code.djangoproject.com/
highlighting the differences between Django's original implementation and the
improved version that
Aymeric Augustin added the comment:
The latest patch removes the current statement parsing and unexpected implicit
commits. It looks good to me.
Unfortunately it also introduces a new kind of statement parsing that detects
DDL statements and doesn't open a transaction in that case, whi
26 matches
Mail list logo