subconsciousnetwork / noosphere

Noosphere is a protocol for thought; let's discover it together!
Apache License 2.0
666 stars 40 forks source link

chore: Task Workers Revamp #796

Closed jsantell closed 7 months ago

jsantell commented 8 months ago

Decoupled Worker Tasks

Worker tasks are now abstracted such that routes now send jobs via a JobClient decoupled from where the work is performed. A standalone noosphere_gateway::jobs::worker_queue module provides the work distribution logic, with each processor receiving a GatewayJobContext that provides access to sphere contexts, IPFS, and name resolvers when processing a job.

Minimize external queries

GatewayManager and routes were updated to minimize GM queries (https://github.com/subconsciousnetwork/noosphere/issues/753).

In addition to a single, cacheable baseline query for scope, unauthenticated routes now has one less external query, and authenticated routes also has one less external query, with another query moved behind authorization.

Ultimately handler logic should not be changed, other than moving Push handler's queueing of name record publishing behind IPFS syndication.

Caveats/Concerns/Enhancements

github-actions[bot] commented 8 months ago

Test flake analysis

No flakes detected πŸŽ‰

status platform features toolchain
🟒 ubuntu-latest test-kubo,headers stable
🟒 ubuntu-latest test-kubo,headers,rocksdb stable
🟒 ubuntu-latest test-kubo,headers nightly
🟒 macos-13 test-kubo,headers,rocksdb stable
🟒 macos-13 test-kubo,headers stable
🟒 windows-latest test-kubo,headers stable
jsantell commented 8 months ago

Added explicit checks on existence of name records after syncing changes in tests, possibly clearing up a handful of intermittent failures.

Windows builds are having an unrelated issue: https://github.com/subconsciousnetwork/noosphere/pull/805

jsantell commented 8 months ago

Added time out support, recreating the hanging worker thread and attempting to resubmit the job. Of note, the SingleTenantJobClient is set to only 1 attempt for now, until we normalize what an error is in the job processors

jsantell commented 7 months ago

Rebasing on #815

cdata commented 7 months ago

Ipfs syndication revision parameter now optional (unused? to confirm)

IIRC we now syndicate full spheres at a time to IPFS, so it isn't necessary to track this.

jsantell commented 7 months ago

Updates (commit):