Skip to content

Allow the ProviderManager to have more paralleism #729

@aschmahmann

Description

@aschmahmann

The ProviderManager has a single event loop for managing all requests (puts, gets, etc.)

func (pm *ProviderManager) run(proc goprocess.Process) {

The major operations in the event loop such as add and get provider block the event loop and can potentially take a long time (e.g. a network based datastore lookup)

case np := <-pm.newprovs:
err := pm.addProv(np.key, np.val)
if err != nil {
log.Error("error adding new providers: ", err)
continue
}
if gcSkip != nil {
// we have an gc, tell it to skip this provider
// as we've updated it since the GC started.
gcSkip[mkProvKeyFor(np.key, np.val)] = struct{}{}
}
case gp := <-pm.getprovs:
provs, err := pm.getProvidersForKey(gp.key)
if err != nil && err != ds.ErrNotFound {
log.Error("error reading providers: ", err)
}
// set the cap so the user can't append to this.
gp.resp <- provs[0:len(provs):len(provs)]

This would lead to the provide manager getting backlogged and a slow down in network responses.

If instead we allow for parallelism on the calls happening within the event loop, such as allowing many adds or gets happening at the same time, then we'd be enabling users to reduce response latencies by increasing the resources they use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/daysEstimated to take multiple days, but less than a weekexp/intermediatePrior experience is likely helpfulkind/enhancementA net-new feature or improvement to an existing featureneed/triageNeeds initial labeling and prioritization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions