Giter VIP home page Giter VIP logo

Comments (4)

ajcasagrande avatar ajcasagrande commented on July 18, 2024

@weichou1229 seems like a 503 - Service Unavailable is the right code, but the message is the problem? Also 502 or 504 could potentially be used as well, but 503 probably makes the most sense.

from device-onvif-camera.

weichou1229 avatar weichou1229 commented on July 18, 2024

@ajcasagrande

seems like a 503 - Service Unavailable is the right code

Yes, the 503 is right.

I thought the problem is we used 5s to create a new Onvif client. The HTTP request already timeout on the service level even if the Onvif client threw the unavailable error.

service HTTP timeout

  Service:
    ...
    RequestTimeout: "5s"

https://github.com/edgexfoundry/edgex-go/blob/0d6a49cb75d16cdeffa3d89b53872b828db0197b/cmd/core-common-config-bootstrapper/res/configuration.yaml#L31

Onvlif client timeout

# Custom configs
[AppCustom]
# The number of seconds to wait when making an Onvif request before timing out
RequestTimeout = 5 # Seconds

onvifDevice, err := onvif.NewDevice(onvif.DeviceParams{
Xaddr: xAddr,
Username: credential.Username,
Password: credential.Password,
AuthMode: credential.AuthMode,
HttpClient: &http.Client{
Timeout: time.Duration(requestTimeout) * time.Second,
},
})
if err != nil {
return nil, errors.NewCommonEdgeX(errors.KindServiceUnavailable, "failed to initialize Onvif device client", err)
}

from device-onvif-camera.

cloudxxx8 avatar cloudxxx8 commented on July 18, 2024

@ajcasagrande This issue cause the automation test case failed. May we set the default AppCustom.RequestTimeout config to 4 (less than the service request tmieout)? Then, the service can reply the proper error content in the response. If you agree with this solution, I can assign someone to work on it. Thanks.

from device-onvif-camera.

ajcasagrande avatar ajcasagrande commented on July 18, 2024

@cloudxxx8 yes that is fine

from device-onvif-camera.

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.