Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response message tracing #327

Merged
merged 9 commits into from
Jan 7, 2022
Merged

Conversation

hannahhoward
Copy link
Collaborator

Goals

Trace the path of each out going response

Implementation

There are three layers of traces here:

  1. Tracking each message sent through the message queue
    1. Produces: message -> sendMessage traces (where message encompasses the entire lifecycle of the message while sendMessage only covers the process of sending it over the wire)
  2. Tracking each transaction in the ResponseAssembler
    1. Produces: response -> transaction -> execute-> message-build (where transaction encompasses the the whole transaction, execute encompasses the whole call to AllocateAndBuildMessage time including waiting for memory to be allocated, and message-build includes only the time building the messageQueue message)
    2. Links: message-build -> message span of the message the data ends up in
  3. Tracking each block traversed in the QueryExecutor
    1. Produces: response -> executeTask -> processBlock
      1. -> loadBlock
      2. -> sendBlock -> processBlockHooks
    2. Links: sendBlock -> transaction

messagequeue/messagequeue.go Outdated Show resolved Hide resolved
}
}

func (qe *QueryExecutor) nextBlock(taskData ResponseTask) (ipld.Link, []byte, error) {
func (qe *QueryExecutor) nextBlock(ctx context.Context, taskData ResponseTask) (ipld.Link, []byte, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this should be renamed now to loadBlock, or call it loadCurrentBlock and don't return the link since it's now being pulled up to in the caller for span metadata so it's a pointless variable overwrite.

Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message-build naming convention thing is the thing that concerns me most, otherwise my other comments are just suggestions or requests for clarification.

The length of these traces is getting large, it'll be interesting to see them in diagnostic tooling! And yeah, graphsync_test.go is getting a bit out of hand with keeping up with the tracing. I really like how explicit it is, but it's probably getting a bit burdensome to keep updated, so maybe for now we should just remove the traces from a few of the tests where they're either super-simple cases or don't test anything novel about the traces.

@hannahhoward hannahhoward merged commit 170ca8d into main Jan 7, 2022
@mvdan mvdan deleted the feat/response-message-tracing branch January 10, 2022 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants