You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
InstrumentationContext onDispatched not called for parsing #1620
Describe the bug
For a couple of the methods on Instrumentation (beginParse and beginValidation) the onDispatched method on the returned InstrumentationContext is not called.
To Reproduce
My Instrumentation, which is later passed into a GraphQL instance:
public class TestInstrumentation extends SimpleInstrumentation {
@Override
public InstrumentationContext<Document> beginParse(InstrumentationExecutionParameters parameters) {
return new InstrumentationContext<>() {
@Override
public void onDispatched(CompletableFuture<Document> result) {
System.out.println("Dispatched");
}
@Override
public void onCompleted(Document result, Throwable t) {
System.out.println("Completed");
}
};
}
}
For now, I am calling onDispatch before returning the InstrumentationContext from the Instrumentation, as I don't need the future. That way will be easiest to modify back into how it should be, should this be fixed.
Hello, this issue has been inactive for 60 days, so we're marking it as stale. If you would like to continue this discussion, please comment within the next 30 days or we'll close the issue.
Activity
Keisuki commentedon Aug 14, 2019
This appears to apply to beginExecution also.
bbakerman commentedon Aug 17, 2019
Yeah this is an oversight because the actions here are not asynchronous. That is they have no clear dispatch and later completion.
I agree for consistency they should happen even if its happening synchronously.
As a workaround I guess you should do you call back work in the onCompleted callback until we get this fixed.
Keisuki commentedon Aug 19, 2019
For now, I am calling onDispatch before returning the InstrumentationContext from the Instrumentation, as I don't need the future. That way will be easiest to modify back into how it should be, should this be fixed.
github-actions commentedon Jan 4, 2024
Hello, this issue has been inactive for 60 days, so we're marking it as stale. If you would like to continue this discussion, please comment within the next 30 days or we'll close the issue.
dondonz commentedon Jan 6, 2024
Fixed by #2730