-
Notifications
You must be signed in to change notification settings - Fork 6
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
Implemented callstack capture task #34
Draft
Fluxie
wants to merge
8
commits into
Rantanen:master
Choose a base branch
from
Fluxie:topic/callstack-ui-message
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The tester consists of three parts: grpc-tester, grpc-generator and grpc-server. Tester is a library which enables units tests to start and stop the testing framework. The generator sends messages to server and server will collect statistics of the messages it receives. This initial implementation does not allow injecting the proxide proxy between the grpc-generator and grpc-server. This functionality will be added in another pull request. #### grpc-tester The tester is a Rust library with an interface for starting and tying the generator and server together. During the startup it ensures the connection between the generator and the server are ready before returning the tester to ensure unit tests utilizing the tester won't experience random timing related failures. Both the generator and the server are started in their own tokio runtimes to isolate the runtime used for testing. The threads associated with the generator and the server have named threads so that they can be distinguished in the debugger. #### grpc-generator The generator periodically sends gRPC requests (SendMessage) to the server. The purpose of the generator is to provide a constant stream of message that can be observed with the proxide proxy. #### grpc-server The server's main purpose is to receive and then ignore the messages it receives. A support for retrieving statistics of the received messages will be added in the future.
The generator now takes "tasks" parameter which tells it how many tasks it should launch. The server counts the number of send_message calls it has processed and the generator periodically retrieves this value and reports how many such calls have been processed in one millisecond. The goal of this is to enable performance assessment of the proxide proxy. Includes linting support in the pipeline.
The first unit test for proxide is now implemented with the help of the grpc_tester library which enables the unit test to start and stop gRPC server and gRPC message generation client. The new server and generator allows the test to check whether proxide is able to intercept messages. In this first iteration the test only verifies that this basic principle works.
This step prepares for the client stack capture support implementation for the proxide proxy. The goal is for proxide to capture the callstacks of the threads of client process when the traffic from the client goes through the proxide. This enables analysis of the client application behavior when unexpected calls pass through the proxy. Functionality will be available when the proxide proxy is on the same host machine as the client.
The area becomes visible if the client included both the process id and the thread id of the calling thread in the headers of a request. Support for capturing and displaying the callstack will be added in another commit.
Proxide panics when launched from RustRover. I tried to locate the source of the panic. Though it always seemed to come from the internals of the Rust main runtime. Launching the application in debug mode does not trigger the panic. The application does not panic if a pause of 500 milliseconds is added before the "let chunk = f.size();" gets executed in marcos.rs:draw_views function. The pause can be anywhere between the first line in main() and the function mentioned above. unwrap -> expect conversions were done while hunting for this issue.
Fluxie
force-pushed
the
topic/callstack-ui-message
branch
2 times, most recently
from
December 23, 2023 15:07
18d71d6
to
9e2de1c
Compare
Currently the task in htt2p.rs only reports that capturing the callstack is not supported on any operating system. But now with the asynchronously executed capture task it will be possible to actually implement the capturing.
Fluxie
force-pushed
the
topic/callstack-ui-message
branch
from
December 23, 2023 15:10
9e2de1c
to
7e3d358
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the task in htt2p.rs only reports that capturing the callstack is not supported on any operating system. But now with the asynchronously executed capture task it will be possible to actually implement the capturing.