cloudant / python-cloudant

A Python library for Cloudant and CouchDB
Apache License 2.0
163 stars 55 forks source link

Add new keep_alive param to couchdb class #492

Closed DaniloOliveira28 closed 3 years ago

DaniloOliveira28 commented 3 years ago

Checklist

Description

It is common to prepare and open a session to connect to iterate with couchdb. However, when you open a session, not necessarly you iterating with the database, you could be executing some transformation job. If you leave the session idle, the server could kill you connection and if you try to use the connection, the client raise an protocol error. See issue 461 Fixes #461

Approach

To avoid the ECONNRESET error you should open the connection with Connection: close header. This pr add a param that allow the user handle if he wants the default behavior, ie, keep alive true or not.

Schema & API Changes

Add param keep_alive to couchdb keep_alive

Security and Privacy

"No change"

Testing

Monitoring and Logging

"No change"