Skip to content

Using $expand on nested entities causes timeouts #350

@webb-ben

Description

@webb-ben

Steps to Reproduce

Request with nested expand for Datastreams and ObservedProperty

/v1.1/Things?$top=1&$expand=Datastreams/ObservedProperty -> 200

Request with nested expand for Datastreams and Observations

/v1.1/Things?$top=1&$expand=Datastreams/Observations -> 504
/v1.1/Things?$top=1&$expand=Datastreams/Observations($top=1) -> 504

This seems to also affect the Datastream when selected by Thing id:

/v1.1/Things(XXX)/Datastreams?$expand=Observations -> 504 (Slow)
/v1.1/Datastreams(YYY)/Observations -> 200 (Fast, where Thing XXX has Datastream YYY)

Expected Behavior

When sending a SensorThings HTTP request with nested expand the Server will expand the relevant entities without issue.

Actual Behavior

Certain entity paths cause 504 timeouts producing a generic CloudFront error page:

504 Gateway Timeout ERROR
The request could not be satisfied.
We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
Generated by cloudfront (CloudFront) HTTP3 Server
Request ID: YaeFs3UT7d5-jdsgJ35qvGBDIm-AUKlzquXVd-k3DdcNIfw4zIFg8A==

Any additional comments?

Not sure if this has to do with caching certain requests or if there is a performance bottleneck with selecting Observations from the Thing entity

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions