This repository was archived by the owner on Mar 13, 2025. It is now read-only.
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
[$250] DynamoDB Timeout #396
Closed
Description
@afrisalyp - We're seeing timeouts now in other operations (not just git access links). See below for a log when a user tried to archive a project.
What we're thinking is that:
- Maybe we should use
query
instead ofscanOne
? - Are the indices correct for how we are querying / scanning? I see we have an index on
tcDirectId
, but do we need any other indices to speed things up?
From @rootelement :
i don’t believe this is correct:
https://github.com/topcoder-platform/topcoder-x-ui/blob/develop/src/common/db-helper.js#L85
all()
?
you’re trying to pull the whole table and filter it?
i know query is better than scan, but scan might need a better hash and range key based on the model you’re trying to pull from
2021-05-25T08:08:07.246-04:00 error: DynamoDB scanOne error Error: Wait for Active timed out after 180000 ms.
2021-05-25T08:08:07.246-04:00 error: Error happened in undefined
2021-05-25T08:08:07.246-04:00 Error: Wait for Active timed out after 180000 ms.
2021-05-25T08:08:07.246-04:00 at Timeout.waitForActive [as _onTimeout] (/topcoder-x-ui/node_modules/dynamoose/dist/Table.js:198:36)
2021-05-25T08:08:07.246-04:00 at listOnTimeout (internal/timers.js:554:17)
2021-05-25T08:08:07.246-04:00 at processTimers (internal/timers.js:497:7)
2021-05-25T08:08:07.247-04:00 error: Error happened in system
2021-05-25T08:08:07.247-04:00 TypeError: Cannot read property 'count' of undefined
2021-05-25T08:08:07.247-04:00 at /topcoder-x-ui/src/common/db-helper.js:91:29
2021-05-25T08:08:07.247-04:00 at /topcoder-x-ui/node_modules/dynamoose/dist/Scan.js:267:24
2021-05-25T08:08:07.247-04:00 at _rejected (/topcoder-x-ui/node_modules/q/q.js:864:24)
2021-05-25T08:08:07.247-04:00 at /topcoder-x-ui/node_modules/q/q.js:890:30
2021-05-25T08:08:07.247-04:00 at Promise.when (/topcoder-x-ui/node_modules/q/q.js:1142:31)
2021-05-25T08:08:07.247-04:00 at Promise.promise.promiseDispatch (/topcoder-x-ui/node_modules/q/q.js:808:41)
2021-05-25T08:08:07.247-04:00 at /topcoder-x-ui/node_modules/q/q.js:624:44
2021-05-25T08:08:07.247-04:00 at runSingle (/topcoder-x-ui/node_modules/q/q.js:137:13)
2021-05-25T08:08:07.247-04:00 at flush (/topcoder-x-ui/node_modules/q/q.js:125:13)
2021-05-25T08:08:07.247-04:00 at processTicksAndRejections (internal/process/task_queues.js:75:11)