-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Hi @tea-artist ,
When performing an HTTP PATCH to update a single record in self-hosted Teable, I'm consistently getting 408 request timeout errors that look like this:
TimeoutHttpException: Request timeout
at Proxy.<anonymous> (/app/community/packages/db-main-prisma/dist/prisma.service.js:25:35)
at async ReferenceService.getRecordMap (/app/enterprise/backend-ee/dist/index.js:60146:28)
at async ReferenceService.getRecordMapBatch (/app/enterprise/backend-ee/dist/index.js:60132:16)
at async ReferenceService.calculateLinkRelatedRecords (/app/enterprise/backend-ee/dist/index.js:59602:38)
at async ReferenceService.calculate (/app/enterprise/backend-ee/dist/index.js:59713:17)
at async ReferenceService.calculateRecordData (/app/enterprise/backend-ee/dist/index.js:59688:9)
at async ReferenceService.calculateOpsMap (/app/enterprise/backend-ee/dist/index.js:59567:9)
at async RecordCalculateService.calculate (/app/enterprise/backend-ee/dist/index.js:120129:9)
at async RecordCalculateService.calculateUpdatedRecord (/app/enterprise/backend-ee/dist/index.js:120160:9)
at async /app/enterprise/backend-ee/dist/index.js:125847:20
at async /app/community/packages/db-main-prisma/dist/prisma.service.js:89:28
at async Proxy._transactionWithCallback (/app/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client/runtime/library.js:130:7984)
at async /app/community/packages/db-main-prisma/dist/prisma.service.js:82:22
at async Proxy.$tx (/app/community/packages/db-main-prisma/dist/prisma.service.js:81:9)
at async RecordOpenApiService.updateRecords (/app/enterprise/backend-ee/dist/index.js:125835:30)
at async descriptor.value (/app/enterprise/backend-ee/dist/index.js:126169:32)
The data being sent in the HTTP payload is about 1MB in size.
I get this error after about 5 seconds from the start of the HTTP request.
I believe the reason why this is happening is that the resultant DB insert operation is taking longer than 5 seconds to complete, and Prisma is terminating the operation after the default 5 seconds, as listed here:
teable/packages/db-main-prisma/src/prisma.service.ts
Lines 82 to 88 in cd0099f
async $tx<R = unknown>( | |
fn: (prisma: Prisma.TransactionClient) => Promise<R>, | |
options?: { | |
maxWait?: number; | |
timeout?: number; | |
isolationLevel?: Prisma.TransactionIsolationLevel; | |
} |
Currently, because this is a updating a single record via HTTP PATCH, the BIG_TRANSACTION_TIMEOUT
does NOT apply.
Can we please either:
- Update the HTTP PATCH for single records to ALSO use the BIG_TRANSACTION_TIMEOUT logic?
OR - Can we get a NEW environment variable to override the default 5 second Prisma timeout for HTTP PATCH operations?