-
Notifications
You must be signed in to change notification settings - Fork 69
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
Client should send status report on reconnect #55
Comments
Here is the section of the spec regarding the agent sending a status report upon connection. I doesn't specifically address reconnecting, but I think this is implied. |
@andykellr you are right. The status report should be sent after reconnecting. Will you be able to submit a PR with a fix? |
@tigrannajaryan I'm working on a PR for this, but will not have anything to show by this afternoons work group. |
Resolves: #55 This PR ensures that the client includes AgentDescription every time it connects to the server, not just after `client.Start`. Current behavior: - Clients connection to server is interrupted. - Client reconnects. - Client does not prepare a "first status message" with an `AgentDescription`. Expected behavior: - Clients connection to server is interrupted. - Client reconnects. - Client prepares and sends a status including AgentDescription.
Currently, the status report message is prepared here in client.Start:
opamp-go/client/clientimpl.go
Lines 109 to 113 in 5255de5
It then begins runUntilStopped and in runOneCycle it ensures it is connected before entering the ReceiverLoop to receive massages from the server:
opamp-go/client/clientimpl.go
Lines 313 to 318 in 5255de5
If the connection is closed, it will repeat runOneCycle and reconnect, but after reconnection no status message is sent because no message has been prepared.
In our own agent, the workaround was to call SetAgentDescription in the OnConnect callback, but I think the implementation should be doing this automatically.
The text was updated successfully, but these errors were encountered: