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

[8.0] Separate handler class per service #6943

Merged
merged 4 commits into from
Jun 5, 2023

Conversation

atsareg
Copy link
Contributor

@atsareg atsareg commented Mar 28, 2023

In the current Tornado HTTPS services implementation, Tornado is getting handler classes of each service which are used for creating handler objects to serve requests. The service configuration is made on the class level, for example, the database references. This lead to a problem that if two services, e.g. File Catalogs, use the same handler class, e.g. TornadoFileCatalogHandler, then the configuration of one service is overwritten by another one on the class level. This PR fixes the problem by creating separate derived handler class on the fly for each service which keeps the appropriate service configuration.
In particular, this PR should fix the problem with the MultiVOFileCatalog mentioned in #6769
There is also some simplification in the way how the full component name is evaluated leaving less freedom for developers which I think is the right thing. Only the service name as defined in the CS is taken

BEGINRELEASENOTES

*Core
FIX: HandlerManager - create separate class for each service handler
FIX: BaseRequestHandler - fullComponentName can be only defined in the configuration

ENDRELEASENOTES

@atsareg atsareg requested a review from fstagni as a code owner March 28, 2023 20:42
@DIRACGridBot DIRACGridBot added the alsoTargeting:integration Cherry pick this PR to integration after merge label Mar 28, 2023
@atsareg atsareg changed the title Fix multiservice https [8.0] Separate handler class per service Mar 28, 2023
@fstagni
Copy link
Contributor

fstagni commented Mar 29, 2023

I can't fully evaluate the consequences of this PR, but I would suggest to (in this order)

would you do both? In case you need a quick-ish recipe on how to push to my PR, I normally do:

git fetch upstream pull/6769/head:localBranch-6769
git co localBranch-6769
...commits... (cherry-picks in your case)
git push git@github.com:fstagni/DIRAC.git localBranch-6769:81_tests_https

@chaen
Copy link
Contributor

chaen commented Mar 29, 2023

That is the sort of PR that terrifies me, because not only are the internals totally obscure, but it is absolutely not tested.
So I would definitely not feel comfortable having it in v8.0.

Moreover, I thought we agreed at the last BILD (or the one before) not to touch anymore that devilish framework beyond the trivial fix #6905

@atsareg
Copy link
Contributor Author

atsareg commented Mar 29, 2023

@chaen: First, it is tested in the EGi test service. Second, the problem was introduced with the original https services that did not take this case into account. So, this is a fix to a very old problem which prevented exploring https services in the EGI environment, for example. Finally, this fixes this problem. The internals of this particular fix is quite clear (can not say so about the rest of this code indeed), so, I do not think it is introducing more entropy than before.

As for putting it into 8.0 - indeed this looks dangerous for the production branch. Even if it was tested in EGI these are less comprehensive tests than the certification. That's why the idea is to cherry-pick it into integration to test in the certification hackathon first

@atsareg atsareg removed the alsoTargeting:integration Cherry pick this PR to integration after merge label Mar 29, 2023
@chaen
Copy link
Contributor

chaen commented Mar 29, 2023

The internals of this particular fix is quite clear

Frankly not to me, but I trust you know what you are doing.

It seems indeed that a particular use case was overlooked at the beginning, but you could easily work around by running another tornado server in a separate process, like we do for the master CS for example.
yes, it's an operational fix, but it is way safer

@atsareg
Copy link
Contributor Author

atsareg commented Apr 20, 2023

This changes are merged to integration and tested in the certification hackathon. Note that the actual change is one line

. Others are rather cosmetics. Further comments ?

@chrisburr
Copy link
Member

Further comments ?

Do we have a fix for the impersonation? Until #6877 is understood I think it's a very bad idea to be running HTTPS services.

@chaen
Copy link
Contributor

chaen commented Apr 22, 2023

Further comments ?

Do we have a fix for the impersonation? Until #6877 is understood I think it's a very bad idea to be running HTTPS services.

As far as LHCb is concerned, there is not going to be a single HTTPs service deployed until there is a PR which

  1. fixes it
  2. comes with a test that fails before, passes after

But I can only speak for LHCb.

@fstagni
Copy link
Contributor

fstagni commented May 4, 2023

Further comments ?

Do we have a fix for the impersonation? Until #6877 is understood I think it's a very bad idea to be running HTTPS services.

As far as LHCb is concerned, there is not going to be a single HTTPs service deployed until there is a PR which

  1. fixes it
  2. comes with a test that fails before, passes after

But I can only speak for LHCb.

We have yet to demonstrate that the current https service are to be blamed, as the ReportGenerator is a DISET service. I don't see this PR making anything bad.

@fstagni
Copy link
Contributor

fstagni commented Jun 5, 2023

Can't see nothing wrong with this PR. Merging.

@fstagni fstagni merged commit a92f758 into DIRACGrid:rel-v8r0 Jun 5, 2023
@DIRACGridBot DIRACGridBot added the sweep:ignore Prevent sweeping from being ran for this PR label Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep:ignore Prevent sweeping from being ran for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants