Documentation ¶
Overview ¶
Package exportnotifier is responsible for dispatching "invocation ready for export" notifications, used to trigger low-latency exports from ResultDB. Notifications are dispatched when all of the following criteria is met:
- The invocation is included by an export root, AND
- The invocation is locally immutable - signified by the invocation being in FINALIZING (or FINALIZED) state, AND
- The sources the invocation are final. This could be because the sources were specified concretely and invocation is final (see above) or the invocation is inheriting sources, and those sources are available and final.
Index ¶
Constants ¶
View Source
const ( // The number of export root rows to propagate to in one transaction. // This should balance Spanner mutation limits, efficiency of using // larger transactions and the risk of contention. BatchSizeInExportRootRows = 1000 )
Variables ¶
View Source
var NotifyReadyForExportPublisher = tq.RegisterTaskClass(tq.TaskClass{ ID: "notify-ready-for-export", Topic: v1NotifyReadyForExportTopic, Prototype: &taskspb.NotificationInvocationReadyForExport{}, Kind: tq.Transactional, Custom: func(ctx context.Context, m proto.Message) (*tq.CustomPayload, error) { t := m.(*taskspb.NotificationInvocationReadyForExport) notification := t.Message blob, err := (protojson.MarshalOptions{Indent: "\t"}).Marshal(notification) if err != nil { return nil, err } if err := realms.ValidateRealmName(notification.RootInvocationRealm, realms.GlobalScope); err != nil { return nil, err } project, _ := realms.Split(notification.RootInvocationRealm) attrs := map[string]string{ "luci_project": project, } return &tq.CustomPayload{ Meta: attrs, Body: blob, }, nil }, })
NotifyReadyForExportPublisher describes how to publish to cloud pub/sub notifications that an invocation has been finalized.
View Source
var RunExportNotificationsTasks = tq.RegisterTaskClass(tq.TaskClass{ ID: "propagate-export-roots", Prototype: &taskspb.RunExportNotifications{}, Kind: tq.Transactional, Queue: "exportnotifier", RoutingPrefix: "/internal/tasks/exportnotifier", })
RunExportNotificationsTasks describes how to route run export notification tasks.
Functions ¶
func EnqueueTask ¶
func EnqueueTask(ctx context.Context, task *taskspb.RunExportNotifications)
EnqueueTask transactionally enqueues a RunExportNotifications task.
Types ¶
Click to show internal directories.
Click to hide internal directories.