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(gw): close the stomp connections once an error frame occured #11018

Closed
wants to merge 4 commits into from

Conversation

HJianBo
Copy link
Member

@HJianBo HJianBo commented Jun 12, 2023

According to the Stomp v1.2 specification:

The server MAY send ERROR frames if something goes wrong. In this case,
it MUST then close the connection just after sending the ERROR frame

Additional, fixes the is_superuser is not working for all gateways

Fixes https://emqx.atlassian.net/browse/EMQX-10235 https://emqx.atlassian.net/browse/EMQX-10240 https://emqx.atlassian.net/browse/EMQX-10239

Summary

🤖 Generated by Copilot at 394f5d6

This pull request improves the STOMP gateway functionality and testing in the emqx_gateway and emqx_gateway_stomp applications. It fixes a bug in the STOMP frame parser, enhances the error handling and messaging for STOMP commands, refactors the test modules to use helper functions and increase coverage, and merges the authentication result with the client information for better authorization.

PR Checklist

Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:

  • Added tests for the changes
  • Changed lines covered in coverage report
  • Change log has been added to changes/{ce,ee}/(feat|perf|fix)-<PR-id>.en.md files
  • For internal contributor: there is a jira ticket to track this change
  • If there should be document changes, a PR to emqx-docs.git is sent, or a jira ticket is created to follow up
  • Schema changes are backward compatible

Checklist for CI (.github/workflows) changes

  • If changed package build workflow, pass this action (manual trigger)
  • Change log has been added to changes/ dir for user-facing artifacts update

According to the Stomp v1.2 specification:

> The server MAY send ERROR frames if something goes wrong. In this case,
> it MUST then close the connection just after sending the ERROR frame

Additional, fixes the `is_superuser` is not working for all gateways
@HJianBo HJianBo changed the base branch from master to release-51 June 13, 2023 03:49
@HJianBo HJianBo marked this pull request as ready for review June 13, 2023 03:49
@HJianBo HJianBo requested review from a team and lafirest as code owners June 13, 2023 03:49
@HJianBo HJianBo closed this Jun 14, 2023
@yanzhiemq
Copy link
Collaborator

yanzhiemq commented Jun 15, 2023

Bug Fixes

  • Fixed multiple issues with the Stomp gateway, including:

    • Fixed an issue where is_superuser was not working correctly.
    • Fixed an issue where the mountpoint was not being removed in message delivery.
    • After a message or subscription request fails, the Stomp client should be disconnected
      immediately after replying with an ERROR message.

@yanzhiemq
Copy link
Collaborator

yanzhiemq commented Jun 15, 2023

修复

  • 修复了 Stomp 网关的多个问题,包括:
    • 修复了关于 is_superuser 无法正常工作的问题。
    • 修复了 mountpoint 在消息发送中没有被移除的问题。
    • 消息或订阅请求失败后,Stomp 客户端应该在回复错误信息后立即断开。

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.

None yet

3 participants