| 474 | return err != nil && strings.Contains(err.Error(), "max sessions reached") |
| 475 | } |
| 476 | |
| 477 | // isWorkerS3CacheRestoreError reports whether err is the worker-side failure |
| 478 | // to restore the cache-proxy S3 transport before a new session starts (a |
| 479 | // previous session's `duckgres.s3_cache = off` bypass that could not be |
| 480 | // undone; duckdbservice.CreateSession's "restore S3 cache transport before |
| 481 | // session start" error). The failed worker must not serve the session — its |
| 482 | // transport state is unknown — but a fresh worker's restore is a no-op, so |
| 483 | // this class is retried on a recycled acquisition instead of failing the |
| 484 | // client's connect. |
| 485 | func isWorkerS3CacheRestoreError(err error) bool { |
| 486 | return err != nil && strings.Contains(err.Error(), "restore S3 cache transport") |
| 487 | } |
| 488 | |
| 489 | // isWorkerConnPoolTimeoutError reports whether err is the worker-side |
| 490 | // "failed to obtain connection from pool" session-create failure |