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

SYSTEST-9250 1-1 WS Mapping for Proxy Mode #115

Merged
merged 14 commits into from
Mar 15, 2023

Conversation

ksentak
Copy link
Contributor

@ksentak ksentak commented Mar 7, 2023

Create 1-1 WS mapping instead of a singleton WS connection when MF is in proxy mode.

@ksentak ksentak marked this pull request as ready for review March 9, 2023 18:58
server/src/proxyManagement.mjs Outdated Show resolved Hide resolved
server/src/proxyManagement.mjs Outdated Show resolved Hide resolved
server/src/proxyManagement.mjs Outdated Show resolved Hide resolved
server/src/proxyManagement.mjs Show resolved Hide resolved
kschrief
kschrief previously approved these changes Mar 14, 2023
Copy link
Contributor

@michaelcfine michaelcfine left a comment

Choose a reason for hiding this comment

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

I don't really understand the nature of the changes here. See one comment about the naming of one of the methods and a few minor comments. If you're sure this all works, I can approve without really understanding fully what you're changing / doing here.

server/src/messageHandler.mjs Show resolved Hide resolved
server/src/proxyManagement.mjs Outdated Show resolved Hide resolved
@ksentak
Copy link
Contributor Author

ksentak commented Mar 14, 2023

Hey @michaelcfine, I want to give some more background regarding this PR so you can better understand the code changes:

Currently, on each new incoming connection to Mock Firebolt in Proxy Mode a WS object is created and assigned to the user. That same WS object is used to create a "messageHandler" for that user. Inside of that message handler, if Proxy Mode is enabled, a message is forwarded to the proxied endpoint. That forwarding is done through a separate WS object.

That proxying is currently done through a singleton WS object. Ripple opens several connections to MF. The result is mapping several incoming WS objects to one outgoing WS object. An unintended consequence of this is that when events/replies come in from the proxied endpoint, they are not going to the correct incoming WS object and events are not working properly on a Ripple connection.

A solution to the issue mentioned in the above paragraph is to turn the outgoing WS singleton into a 1:1 mapping with each incoming WS object.

When an incoming WS requests a message sent to the proxied endpoint, we now:

Check a WS:WS map to see if the incoming WS object has an outgoing WS object
If the map contains an entry for the incoming WS object, use it
If the map does not contain an entry, create an outgoing WS object and assign it to the map

Copy link
Contributor

@michaelcfine michaelcfine left a comment

Choose a reason for hiding this comment

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

👍 despite not fully understanding the changes / intent here. counting on you / others to fully test.

@kschrief kschrief merged commit 18b761a into rdkcentral:main Mar 15, 2023
@ksentak ksentak deleted the systest-9250 branch April 11, 2023 14:37
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