Code Monkey home page Code Monkey logo

Comments (11)

tdanner avatar tdanner commented on August 23, 2024

Could you clarify what request took more than 30 seconds?

from orionsdk-python.

steffenschumacher avatar steffenschumacher commented on August 23, 2024

Hi,
Its a swis query, where I select all Cisco confines which do not have ssh enabled, only I confine the considered configurations to the most recent ones, which are a bit cumbersome - the equivalent sql query takes 90-120 seconds to execute.

from orionsdk-python.

Angelicvorian avatar Angelicvorian commented on August 23, 2024

Hi, I'm looking to implement timeouts also. I have another python module that uses requests and have gone through that adding in a timeout parameter to prevent issues with expired licenses causing the API to not respond correctly causing a non-response.
I was wondering if the Solarwinds API implements a standard timeout (as i see none in the swis client) or will the connection stay open indefinitely causing the initiating query to not receive a response?

from orionsdk-python.

tdanner avatar tdanner commented on August 23, 2024

Requests on the REST API have a 30 second timeout. This is not configurable or overridable at this time.

from orionsdk-python.

Angelicvorian avatar Angelicvorian commented on August 23, 2024

@tdanner Thanks for the confirmation.

from orionsdk-python.

 avatar commented on August 23, 2024

In the orionsdk/swisclient.py can we edit line ~50 and add "timeout=15" to have the requests module have a 15 second timeout?

http://docs.python-requests.org/en/master/user/quickstart/#timeouts

from orionsdk-python.

tdanner avatar tdanner commented on August 23, 2024

Yes, you could tell requests to use a shorter client-side timeout. I don't think that this will affect what happens on the server though.

from orionsdk-python.

 avatar commented on August 23, 2024

I just realized the original opening of this issue seems to be for the server side, my request is to add the timeout into the SDK client code as the requests python will never timeout, if it is not set.

Example reason why it would be a good idea to add this to the client:

I have a script that checks our SolarWinds instances for some data which does a swis.query() in a loop for each instance. If one of those instances is offline, or the network is down, my loop will never fail or error out as the requests module just sits waiting. I would be nice if the requests module had a hard set, or even configurable timeout of 15-30 seconds so that I can write a nice try/catch on the loop.

I can do a pull request if you'd like, but it is just a add of timeout=30, to line 54 in the swisclient.py. This would set the client SDK to the same timeout as the Orion server API timeout.

from orionsdk-python.

tdanner avatar tdanner commented on August 23, 2024

Your reasoning makes sense to me. PRs welcome. :)

from orionsdk-python.

superadm1n avatar superadm1n commented on August 23, 2024

Considering the fix for this has been implemented in PR #28 and documented in the README how to implement a timeout can someone close this issue as it appears to be resolved?

from orionsdk-python.

danjagnow avatar danjagnow commented on August 23, 2024

As @superadm1n noted, this has been resolved by #28.

from orionsdk-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.