diff --git a/plugin/get_config.go b/plugin/get_config.go index 4c6968b8..87dec4c1 100644 --- a/plugin/get_config.go +++ b/plugin/get_config.go @@ -74,8 +74,7 @@ type GetConfig struct { // Deprecated: use IgnoreConfig ShouldIgnoreError ErrorPredicate - // Deprecated: use RateLimit.MaxConcurrency - MaxConcurrency int + MaxConcurrency int } // initialise the GetConfig @@ -100,7 +99,7 @@ func (c *GetConfig) initialise(table *Table) { c.IgnoreConfig = &IgnoreConfig{} } - // create empty scope values if needed + // create empty tags if needed if c.Tags == nil { c.Tags = map[string]string{} } diff --git a/plugin/plugin_grpc.go b/plugin/plugin_grpc.go index 47ace816..33c47371 100644 --- a/plugin/plugin_grpc.go +++ b/plugin/plugin_grpc.go @@ -316,15 +316,30 @@ func (p *Plugin) establishMessageStream(stream proto.WrapperPlugin_EstablishMess return nil } -func (p *Plugin) setCacheOptions(request *proto.SetCacheOptionsRequest) error { +func (p *Plugin) setCacheOptions(request *proto.SetCacheOptionsRequest) (err error) { + defer func() { + if r := recover(); r != nil { + msg := fmt.Sprintf("setCacheOptions experienced unhandled exception: %s", helpers.ToError(r).Error()) + log.Println("[WARN]", msg) + err = fmt.Errorf(msg) + } + }() + return p.ensureCache(p.buildConnectionSchemaMap(), query_cache.NewQueryCacheOptions(request)) } // clear current rate limiter definitions and instances and repopulate resolvedRateLimiterDefs using the // plugin defined rate limiters and any config defined rate limiters -func (p *Plugin) setRateLimiters(request *proto.SetRateLimitersRequest) error { +func (p *Plugin) setRateLimiters(request *proto.SetRateLimitersRequest) (err error) { log.Printf("[INFO] setRateLimiters") + defer func() { + if r := recover(); r != nil { + msg := fmt.Sprintf("setRateLimiters experienced unhandled exception: %s", helpers.ToError(r).Error()) + log.Println("[WARN]", msg) + err = fmt.Errorf(msg) + } + }() var errors []error // clear all current rate limiters p.rateLimiterDefsMut.Lock() diff --git a/plugin/query_data.go b/plugin/query_data.go index 9c48baac..5ef8ec04 100644 --- a/plugin/query_data.go +++ b/plugin/query_data.go @@ -692,7 +692,7 @@ func (d *QueryData) buildRowsAsync(ctx context.Context, rowChan chan *proto.Row, //log.Printf("[INFO] buildRowsAsync acquire semaphore (%s)", d.connectionCallId) if err := rowSemaphore.Acquire(ctx, 1); err != nil { log.Printf("[INFO] SEMAPHORE ERROR %s", err) - // TODO does this quit?? + // TODO KAI does this quit?? d.errorChan <- err return }