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 tcm intermittent reception #604

Merged
merged 3 commits into from
Apr 17, 2024
Merged

Conversation

dan-du-car
Copy link
Collaborator

@dan-du-car dan-du-car commented Apr 15, 2024

PR Details

Description

Fix the TCM intermittent reception issue where carma cloud sends TCMs in an http request and v2xhub CARMACloudPlugin sometimes does not receive the TCMs. Replace the OpenAI generated code with QhttpEngine recommended functional call, refer to: https://ci.quickmediasolutions.com/job/qhttpengine-documentation/doxygen/classQHttpEngine_1_1QObjectHandler.html.

Related Issue

#601
#603

Motivation and Context

CARMA cloud integration testing

How Has This Been Tested?

Local integration test

Types of changes

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • I have added any new packages to the sonar-scanner.properties file
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
    V2XHUB Contributing Guide
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@dan-du-car dan-du-car marked this pull request as draft April 15, 2024 13:20
@dan-du-car dan-du-car marked this pull request as ready for review April 15, 2024 15:29
Copy link
Contributor

@paulbourelly999 paulbourelly999 left a comment

Choose a reason for hiding this comment

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

Address code smells. It is also not great practice to manually edit generated code but if it is necessary I guess it is not the only place we do this. Lastly do we know at all why the previous implementation did not work? Without knowing that how have we confirmed that this implementation fixes the issue?

@paulbourelly999 Bryan and I both tested this change, and it worked. It is not an edit of the generated code, rather a complete replacement of it with the use the QhttpEngine implementation. I think the generated code did not work for some time now because I receive reports on the message loss from multiple plugins that use this generated code.

Copy link
Contributor

@jwillmartin jwillmartin left a comment

Choose a reason for hiding this comment

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

Using official documentation/guidance is more appropriate than generated code. This looks good and I see your testing passed.

Copy link
Contributor

@jwillmartin jwillmartin left a comment

Choose a reason for hiding this comment

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

My bad, I see there were some code smells when I opened the link to sonar cloud. I agree with Paul on addressing those.

@paulbourelly999
Copy link
Contributor

paulbourelly999 commented Apr 15, 2024

@dan-du-car Wait so the edits are not on the generated code, That makes sense. You mentioned it is a replacement of generated code. Does that mean some of the generated code can be removed? You also mentioned that this is an issue with other OpenAPI generated REST clients/servers. If so we should create issues to remove the problematic code and include any evidence you have of these other services having similar issues.

@paulbourelly999 The generated code is in the server lib. I think some OpenAI related code in the CARMACloudPlugin is a copy with some modification from there: https://github.com/usdot-fhwa-OPS/V2X-Hub/blob/develop/ext/server/src/main.cpp.

Copy link

sonarcloud bot commented Apr 15, 2024

Copy link
Contributor

@paulbourelly999 paulbourelly999 left a comment

Choose a reason for hiding this comment

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

Looks good. If you believe other REST servers (ERV or TIM or Pedestrian ) will have a similar issue please create a GitHub issue to track this.

@dan-du-car dan-du-car merged commit ff9dd7c into develop Apr 17, 2024
3 of 4 checks passed
@dan-du-car dan-du-car deleted the fix_tcm_intermittent_reception branch April 17, 2024 13:29
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.

3 participants