8000 wrong time to call 'TraceBatchFinishFunc' · Issue #63 · graph-gophers/dataloader · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
wrong time to call 'TraceBatchFinishFunc' #63
Open
@jimyang112

Description

@jimyang112
ctx, finish := b.tracer.TraceBatch(originalContext, keys)
defer finish(items) // this should be moved

func() {
	defer func() {
		if r := recover(); r != nil {
			panicErr = r
			if b.silent {
				return
			}
			const size = 64 << 10
			buf := make([]byte, size)
			buf = buf[:runtime.Stack(buf, false)]
			log.Printf("Dataloader: Panic received in batch function:: %v\n%s", panicErr, buf)
		}
	}()
	items = b.batchFn(ctx, keys)
}()

// defer finish(items) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0