Ocelot icon indicating copy to clipboard operation
Ocelot copied to clipboard

Fix the problem while doing first call for service to gateway using p…

Open przemyslawandruszewski opened this issue 3 years ago • 3 comments

Fixes / New Feature # Fix for pollconsul provider for the first request to any service while API gateway uses pollconsul provider.

Proposed Changes

  • Fix the problem of first request before timer will start fetching services from consul

przemyslawandruszewski avatar Feb 01 '22 13:02 przemyslawandruszewski

#1294

przemyslawandruszewski avatar Feb 01 '22 13:02 przemyslawandruszewski

@TomPallister could you have a look? :)

przemyslawandruszewski avatar Feb 01 '22 13:02 przemyslawandruszewski

Hi @TomPallister , could you please have a look? :)

przemyslawandruszewski avatar Feb 23 '22 12:02 przemyslawandruszewski

I could have a look...

Hi Przemyslaw! Could you resolve merge conflicts first, please?

Don't forget to update your feature branch by latest top-commits from base:develop branch!

raman-m avatar May 13 '23 12:05 raman-m

Przemyslaw! There are a lot of merge conflicts! I guess current feature branch is outdated. It is better to backup your changes to some folder. And re-fork the Ocelot repo. SO, you will have top commits from head repo. And create new feature branch from develop. Apply your code changes. Make new PR please!

Or go to my forked Ocelot repo. And it says: "This branch is up to date with ThreeMammals/Ocelot:develop." I can add you as Contributor. You will be able to create feature branches.

Do you have an intention to have some pair programming?

raman-m avatar Jun 22 '23 16:06 raman-m

@przemyslawandruszewski Przemyslaw, I thought you needed my help to resolve merge conflicts. 😉 The feature branch has been rebased onto ThreeMammals:develop successfully! I've additionally linked to the issue from your past comment.

Good luck during code review!

raman-m avatar Sep 07 '23 14:09 raman-m

@chaitanyaphanikumar @lufeiyuan83 @ggnaegi Please, join to code review session!

raman-m avatar Sep 07 '23 14:09 raman-m

@raman-m This should be addressed in https://github.com/ThreeMammals/Ocelot/pull/1670, no?

ggnaegi avatar Sep 18 '23 13:09 ggnaegi

@ggnaegi commented on Sep 18

Yes, it is addressed, but this PR has extra enhancement of injecting IMemoryCache object into PollConsul constructor! 😉

raman-m avatar Sep 20 '23 11:09 raman-m

@ggnaegi commented on Sep 18

Yes, it is addressed, but this PR has extra enhancement of injecting IMemoryCache object into PollConsul constructor! 😉

Like @RaynaldM I think, we are mixing concerns here...

ggnaegi avatar Sep 21 '23 07:09 ggnaegi

@ggnaegi By other words, if we remove caching logic here, this PR become duplicate of yours, right?

Yes, it seems caching inside of provider is bad idea. The provider should communicate to Consul service only. I guess, the author tried to improve performance of the provider, after facing with errors, and this PR is just a try to fix stability of the provider. But this has been addressed in your PR already.

raman-m avatar Sep 25 '23 13:09 raman-m

@przemyslawandruszewski In future we can inject caching interface, but it should not be memory cache, otherwise Ocelot will duplicate all collections from Consul service... I understand, you've tried to improve the performance, but the root cause is Sorry, cannot accept it nowadays. Cache must be more abstract. And we cannot add this caching forcibly, so configuration property is required. If you have an intention to contribute, please return back with reopen or message.

Again, Thanks you for the PR!

raman-m avatar Sep 25 '23 13:09 raman-m

Duplicate of #1670

raman-m avatar Sep 25 '23 13:09 raman-m

#1294 will be fixed by #1670

raman-m avatar Sep 25 '23 13:09 raman-m