Comments (2)
Thank you for the report, but it's actually an intended behaviour. The main idea is that it's better to fail if connection is lost than hang the request trying to connect indefinitely to Tarantool. Take a look at the following script:
import asyncio
import asynctnt
import asynctnt.exceptions
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
async def run():
c = asynctnt.Connection(host='localhost', port=33301)
await c.connect()
while 1:
try:
print(await c.call('box.info')) # <-- Tarantool instance goes down here
except asynctnt.exceptions.TarantoolNotConnectedError:
print('lost connection')
await asyncio.sleep(1)
loop = asyncio.get_event_loop()
try:
loop.run_until_complete(run())
except KeyboardInterrupt:
loop.stop()
loop.close()
If you run it you will see messages like
Connect to Tarantool[localhost:33301] failed: ConnectionRefusedError(111, 'Connection refused'). Retrying in 0.333333 seconds
as asynctnt will try to reconnect to Tarntool in the background.And finally when you start Tarantool instance back it will continue to successfully execute call
statements.
from asynctnt.
I get it. Sorry for bothering.
from asynctnt.
Related Issues (20)
- Space '281' does not exist HOT 1
- Auto-reconnect is broken?
- The results of select() and call() function are different HOT 3
- SQL disable upprecase conversion HOT 1
- Session push hangs on reconnect HOT 4
- no running event loop HOT 1
- Schema fetch error in case of tuned msgpack Tarantool serializer HOT 2
- feature: Transactions support HOT 1
- Support encrypted binary protocol (Tarantool Enterprise)
- Add support for watchers
- Add support for graceful shutdown
- Broken links "Edit on Github" in the documentation HOT 1
- Support new version policy
- Datetime fails on modern 2.10 HOT 1
- Add support for MP_INTERVAL type
- Suppress warnings when space format defined
- Installation fails on Python 3.7 HOT 5
- A problem with reconnect HOT 1
- Don't resend initial request on schema change HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asynctnt.