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

Adapter operational state #299

Closed
wants to merge 45 commits into from
Closed

Adapter operational state #299

wants to merge 45 commits into from

Conversation

bretambrose
Copy link
Contributor

@bretambrose bretambrose commented Jun 16, 2023

  • Synthetic packet id allocation
  • Adapter support for publish/puback
  • Refactor adapter to private header
  • Refactor MQTT5 operation submission to allow adapter internal usage

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov-commenter
Copy link

codecov-commenter commented Jun 16, 2023

Codecov Report

Patch coverage: 89.86% and project coverage change: +0.01 🎉

Comparison is base (83e7abe) 81.09% compared to head (a092386) 81.11%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #299      +/-   ##
==========================================
+ Coverage   81.09%   81.11%   +0.01%     
==========================================
  Files          18       18              
  Lines        7841     7958     +117     
==========================================
+ Hits         6359     6455      +96     
- Misses       1482     1503      +21     
Impacted Files Coverage Δ
source/client.c 69.08% <ø> (-0.10%) ⬇️
source/v5/mqtt5_client.c 87.92% <87.50%> (-0.17%) ⬇️
source/v5/mqtt3_to_mqtt5_adapter.c 71.09% <89.84%> (ø)
source/client_impl_shared.c 83.33% <100.00%> (+1.51%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Base automatically changed from AdapterLifecycleTake2 to main June 25, 2023 02:51
@bretambrose bretambrose marked this pull request as ready for review June 25, 2023 03:36

/* Override timeout, rounding up as necessary */
config->ack_timeout_seconds = aws_timestamp_convert(
connect_task->protocol_operation_timeout_ms + AWS_TIMESTAMP_MILLIS - 1,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious about why would we add 1 second to the operation timeout here?


aws_mqtt5_operation_release(&publish_op->publish_op->base);

aws_mem_release(operation->allocator, operation);
Copy link
Contributor

Choose a reason for hiding this comment

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

Would we like to release publish_op instead of operation here as we allocate the publish_op in aws_mqtt3_to_mqtt5_adapter_operation_new_publish?

Meanwhile, if it was an issue, the tests should catch it. Probably I was wrong here?

struct aws_mqtt_client_connection_5_impl *adapter = operation->base.adapter;

aws_mqtt3_to_mqtt5_adapter_operation_dereference_adapter(&operation->base);
aws_mqtt5_client_submit_operation_internal(
Copy link
Contributor

@xiazhvera xiazhvera Jul 7, 2023

Choose a reason for hiding this comment

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

Would it make more sense to submit first then dereference the operation...?

Shared subscription set implementation

* Topic tree support for mqtt 311 per-subscription publish received callbacks
* Per-topic-filter subscription record tracking for resubscribe support
* The subscription set could eventually replace the topic tree in the mqtt 311 implementation, but for now leave it alone

---------

Co-authored-by: Bret Ambrose <[email protected]>
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.

4 participants