Stand-With-Crypto / swc-web

Stand With Crypto's codebase, open sourced for community collaboration. If you care about crypto, it's time to prove it.
https://www.standwithcrypto.org/
Apache License 2.0
22 stars 5 forks source link

Database queries being cancelled by planetscale #1149

Closed sentry-io[bot] closed 2 months ago

sentry-io[bot] commented 2 months ago

Sentry Issue: PROD-SWC-WEB-1Q9

DatabaseError: target: swc-web.-.primary: vttablet: rpc error: code = Canceled desc = (errno 2013) due to context canceled, elapsed time: 6.331628058s, killing query ID 131212 (CallerID: ok82v1y40107f1cd2lb1)
  File "swc-web/./node_modules/@planetscale/database/dist/index.js", line 90, in Connection.execute
    throw new DatabaseError(error.message, 400, error);
  File "node:internal/process/task_queues", line 95, in process.processTicksAndRejections
  File "swc-web/./node_modules/@prisma/adapter-planetscale/dist/index.mjs", line 137, in PlanetScaleQueryable.performIO
    const result = await this.client.execute(sql, values, {
  File "swc-web/./node_modules/@prisma/adapter-planetscale/dist/index.mjs", line 108, in PlanetScaleQueryable.queryRaw
    const ioResult = await this.performIO(query);
  File "/var/task/node_modules/@prisma/client/runtime/library.js", line 21

Weird things that need investigation: On first glance it appeared this was just vercel canceling long running queries. Upon further investigation in Planetscale, it looks like some of these queries are being cancelled after less than a second https://app.planetscale.com/stand-with-crypto/swc-web/main/insights/errors/6ba88bf10e24ed5e20e57aaa9242c5a2ecabce6a0a65074be729259d556d72e5?

travisbloom-cb commented 2 months ago

Seems potentially high priority, but can't assess technical effort. @travisbloom-cb let me know if you want to timebox an investigation.