PostgresCheckpointerConfig

org.llm4s.agent.graph.postgres.PostgresCheckpointerConfig
See thePostgresCheckpointerConfig companion object
@Experimental
final case class PostgresCheckpointerConfig

How a PostgresCheckpointer uses its database.

  • schema: the PostgreSQL schema its tables live in, llm4s by default, so the store can share a database with other tables (and two stores, in two schemas, can share one database without seeing each other). It is created if it does not exist. A lower-case SQL identifier: a letter or _, then letters, digits or _, at most 63 characters.
  • callTimeout: how long one call may hold its connection - every statement it runs, the waits for row locks another instance holds included - before it fails, changing nothing. It is set on the server as the transaction's statement_timeout, lock_timeout and idle_in_transaction_session_timeout, and enforced on the client too: a call still running when it passes has its connection aborted and discarded, so a call whose network stalls fails at the bound rather than waiting for the socket.
  • connectionTimeout: how long a call waits for a connection from the store's own pool (see PostgresCheckpointer.open); at least 250 milliseconds, HikariCP's minimum. A caller-supplied pool (PostgresCheckpointer.create) keeps its own setting, which then takes this one's place in the bound.
  • maxPoolSize: the size of the store's own pool, 1 to PostgresCheckpointerConfig.MaxPoolSize; ignored for a caller-supplied one.
  • migrationTimeout: how long opening the store may take to bring the schema to this build's version, the wait for another instance's migration included (#3089): its transaction is bounded by this rather than callTimeout, on the server and the client, so a step that rewrites a large table is not cut off. Ten minutes by default; an open that finds the schema current takes no longer than a call.

'''The bound.''' Every call returns within connectionTimeout + callTimeout, plus the time it takes to roll back or discard a connection: the bound the Checkpointer contract asks a store to document (#1919). Keep it well inside ClaimPolicy.ttl - ClaimPolicy.renewEvery (the defaults, 5 + 5 seconds, are inside 30 - 10).

Durations are rounded up to whole milliseconds and must be positive and at most Int.MaxValue milliseconds; apply and the with* setters throw IllegalArgumentException for an invalid value, and PostgresCheckpointerConfig.of returns a ValidationError.

Attributes

Companion
object
Source
PostgresCheckpointerConfig.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

The bound every call of a store with its own pool returns within: connectionTimeout + callTimeout.

The bound every call of a store with its own pool returns within: connectionTimeout + callTimeout.

Attributes

Source
PostgresCheckpointerConfig.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product