self.connection = cx_Oracle.connect( args.user, args.password, args.dsn)
To fix this , create an environment TNS_ADMIN and save file sqlnet.ora , add these line to control the timeout
SQLNET.OUTBOUND_CONNECT_TIMEOUT=10 ms
import os
os.environ["TNS_ADMIN"] = "/script/tnsadmin"
cx_Oracle.connect( args.user, args.password, args.dsn)