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

Fix the bug that AgentExec didn't return right pid number #98

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

Jlan45
Copy link
Contributor

@Jlan45 Jlan45 commented Oct 25, 2023

No description provided.

@Jlan45 Jlan45 closed this Oct 25, 2023
@Jlan45 Jlan45 reopened this Oct 25, 2023
@luthermonson
Copy link
Owner

welp looks like i need an alpha10 now lol.. thanks for the PR and nice catch

@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

Merging #98 (f3f470a) into main (fac5f8a) will decrease coverage by 0.02%.
Report is 1 commits behind head on main.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
- Coverage   26.13%   26.12%   -0.02%     
==========================================
  Files          15       15              
  Lines        1714     1715       +1     
==========================================
  Hits          448      448              
- Misses       1246     1247       +1     
  Partials       20       20              
Files Coverage Δ
virtual_machine.go 2.81% <0.00%> (-0.01%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@luthermonson luthermonson merged commit 413ae35 into luthermonson:main Oct 25, 2023
1 of 3 checks passed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bug: AgentExec always return pid 0 with an error
Reasons: client.Post will finally call client.handleResponse to process the returned json data. At the end, if there is a data key to parse the json data, it will directly bind the data in the data to the value we initially passed.In other functions, we pass in a structure. As long as the json data is parsed normally, we can get a complete return. However, in the AgentExec function, the pid we pass in is an int type. Obviously, json cannot bind the data, resulting in a json deserialization error, which leads to no effective pid return.
Fix:By adding a temporary map object to parse the json data, and then take out the value of the pid and return it.

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