SuperPi.Env.Shared (super_pi v0.1.0)

Copy Markdown View Source

Execution environment for a workspace on shared storage (NFS, CephFS, a read-write-many volume).

Reads, listing and commands are the same as SuperPi.Env.Local. Writes and edits also take a PostgreSQL advisory lock for the path, so two nodes cannot change the same file at once. The SuperPi.Env.FileLock that Local uses only serializes writers on one node.

With SQLite (one node) there is no other node, so the local lock is enough and no advisory lock is taken.

Summary

Functions

Key of the advisory lock for a path: a signed 64-bit integer from a hash of the path.

Functions

lock_key(path)

Key of the advisory lock for a path: a signed 64-bit integer from a hash of the path.