aio-libs / aio-libs/aioftp

"ConnectionResetError: Connection lost" occurs when disk space is 100% used.

Abierto
#182 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
211
Forks
63
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

In case when space is not enough on the server side the **stream.write** operation fails with **ConnectionResetError**.
msg is like that **'Connection lost'**, and that's it, nothing is useful at all:

```python
from aioftp import Client

async def main():
client = Client()
await client.connect(
'0.0.0.0',
port=21,
)
await client.login(
user='',
password='*',
)
try:
stream = await client.upload_stream('test.txt', offset=0)
await stream.write(b'data' * 1000)
except ConnectionResetError:
prepare_next_try()
```

Is there way to recognize that the problem is related to the shortage of volume rather than network issue?
If there is, then it would be helpful to make a stop of uploading instead of keep trying to reconnect endlessly.

Here is an example which shows something similar i suppose to have:

```python
try:
stream = await client.upload_stream('test.txt', offset=0)
await stream.write(b'data' * 1000)
except ConnectionResetError:
prepare_next_try()
except NoSpaceError:
stop_uploading()
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.