Skip to content

fix(traffic-split): upstream_obj.upstream should not be a string#11932

Merged
nic-chen merged 3 commits into
apache:masterfrom
shreemaan-abhishek:fix-tfsp-rload
Jan 22, 2025
Merged

fix(traffic-split): upstream_obj.upstream should not be a string#11932
nic-chen merged 3 commits into
apache:masterfrom
shreemaan-abhishek:fix-tfsp-rload

Conversation

@shreemaan-abhishek

@shreemaan-abhishek shreemaan-abhishek commented Jan 22, 2025

Copy link
Copy Markdown
Contributor

Description

During creation of roundrobin object for upstream in traffic-split. upstream_obj.upstream: 1 is assigned a string if the upstream configuration only has the weight value.

In this case, if we reload the plugin via the plugin reload API. The roundrobin object gets recreated but since upstream_obj.upstream has a string value. upstream_obj.upstream.vid = i: 2 causes panic because it expects upstream_obj to be a table.

fix #9831 #5607

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@shreemaan-abhishek
shreemaan-abhishek marked this pull request as ready for review January 22, 2025 04:54
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

help request: traffic-split plugin occurs error

4 participants