andreiko / adns-python

Automatically exported from code.google.com/p/adns-python
0 stars 1 forks source link

Assertion 'tvp' failed #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I got the following error while using adns:

python2.5: ../src/event.c:708: adns_wait: Assertion `tvp' failed.

My script dies right after the error. My python code is

DNS = adns.init()
status, _cname, expires, answer = DNS.synchronous(netloc, adns.rr.CNAME)

The code is running inside different threads. I am using adns-1.2 and
adns-python-1.2.1 on Ubuntu Dapper with a custom-built python2.5.

Original issue reported on code.google.com by ludovico...@siassb.eu on 4 Sep 2007 at 2:27

GoogleCodeExporter commented 9 years ago
Are you using the same DNS object in different threads? Since you are using a
synchronous lookup, this is probably a bad idea. I don't know if the adns 
library is
thread-safe or not. I would tend to suspect it isn't because it's designed for
asynchronous operation which tends to be single-threaded.

I would recommend using separate DNS objects per thread if you are doing 
synchronous
lookups, as synchronous lookups will block until the answer is returned.

Original comment by farcep...@gmail.com on 4 Sep 2007 at 2:39

GoogleCodeExporter commented 9 years ago
Thank you, I suspected as much. I will change my code and check if the error 
persists.

Original comment by ludovico...@siassb.eu on 4 Sep 2007 at 2:43

GoogleCodeExporter commented 9 years ago
Don't forget to report your findings here.

Original comment by farcep...@gmail.com on 4 Sep 2007 at 7:02

GoogleCodeExporter commented 9 years ago
I localized the dns client for each thread, and everything seems to work. 
Classic
newbie mistake, thanks for pointing it out. :)

Original comment by ludovico...@siassb.eu on 6 Sep 2007 at 12:35

GoogleCodeExporter commented 9 years ago
Closing

Original comment by farcep...@gmail.com on 6 Sep 2007 at 3:23