@@ -204,6 +204,7 @@ type Handle struct {
204204 pythonTransformConfig transformerutils.PythonTransformConfig
205205 userTransformationMirroringBlockedIDs config.ValueLoader [[]string ]
206206 storeSamplerEnabled config.ValueLoader [bool ]
207+ forkRsourcesTrackedJobs bool
207208 }
208209
209210 drainConfig struct {
@@ -827,6 +828,7 @@ func (proc *Handle) loadConfig() {
827828 // GWCustomVal is used as a key in the jobsDB customval column
828829 proc .config .GWCustomVal = proc .conf .GetStringVar ("GW" , "Gateway.CustomVal" )
829830 proc .config .pythonTransformConfig = transformerutils .LoadPythonTransformConfig (proc .conf )
831+ proc .config .forkRsourcesTrackedJobs = proc .conf .GetBoolVar (false , "Processor.DestinationIsolation.forkRsourcesTrackedJobs" )
830832 proc .loadReloadableConfig (defaultPayloadLimit , defaultMaxEventsToProcess )
831833}
832834
@@ -2380,10 +2382,9 @@ func (proc *Handle) pretransformStage(partition string, preTrans *preTransformat
23802382 workspaceLibraries := proc .getWorkspaceLibraries (workspaceID )
23812383
23822384 // Destinations whose events are siphoned to the intermediate (proc) jobsdb
2383- // rather than transformed inline. rsources (retl) jobs stay inline until the
2384- // intermediate stage is modelled in rsources accounting.
2385+ // rather than transformed inline.
23852386 var forkedDestIDs []string
2386- forkable := event . Metadata . SourceJobRunID == ""
2387+ forkable := proc . forkableEvent ( event )
23872388 eventFanout := 0
23882389
23892390 for _ , destType := range enabledDestTypes {
@@ -3003,6 +3004,9 @@ func (proc *Handle) storeStage(partition string, pipelineIndex int, in *storeMes
30033004 }
30043005 }
30053006 in .rsourcesStats .CollectStats (statusList )
3007+ // forkedJobs are only ever populated in the gw pool (the proc pool never re-forks),
3008+ // so this is a no-op when storeStage is invoked via procStoreStage.
3009+ in .rsourcesStats .JobsForked (in .forkedJobs )
30063010 statusDB := proc .statusUpdateDB (in )
30073011 commitStatuses := func (ctx context.Context ) error {
30083012 return statusDB .WithUpdateSafeTx (ctx , func (tx jobsdb.UpdateSafeTx ) error {
0 commit comments