KomodoPlatform / komodo-defi-framework

This is the official Komodo DeFi Framework repository
https://komodoplatform.com/en/docs/komodo-defi-framework/
106 stars 94 forks source link

fix(rpc): make sure to run rpc request futures till completion #2237

Closed mariocynicys closed 3 weeks ago

mariocynicys commented 1 month ago

when ran directly inside hyper's service function, it might get aborted mid-way when a client disconnects, leaving the future incomplete.

this is an issue as we might have some code that need to be executed atomically inside any part of the code base that could be triggered by an RPC request. if the client disconnects, such a function will abort on the next await call, leaving us with non-atomic state (e.g. partial update for a map but not its inverse).

mariocynicys commented 1 month ago

let me move this back to in progress and try to give it one more shot at finding if there is a config we can set to let hyper not shutdown our request resolver future when the client disconnects.

EDIT: Nope, there is no config option in hyper for that.

mariocynicys commented 3 weeks ago

Looks like I mistakenly included this PR already in #1966 (https://github.com/KomodoPlatform/komodo-defi-framework/pull/1966/commits/5e380862902e66d9851cbca3bacff0b81f5476cb). Do we want to revert that change from dev now @shamardy? We can also keep this review and any needed changed would be applied here.

shamardy commented 3 weeks ago

Do we want to revert that change from dev now @shamardy? We can also keep this review and any needed changed would be applied here.

No need to revert the change, I will include an entry about it in the changelog https://github.com/KomodoPlatform/komodo-defi-framework/pull/2240#issue-2581550646. I will check this PR and will close it if everything is fine. As I already reviewed https://github.com/KomodoPlatform/komodo-defi-framework/pull/1966, there should be no issues or any changes required I think.

shamardy commented 3 weeks ago

Duplicate as it was handled in https://github.com/KomodoPlatform/komodo-defi-framework/pull/1966