PelicanPlatform / pelican

The Pelican Platform for creating data federations
https://pelicanplatform.org/
Apache License 2.0
11 stars 24 forks source link

Cache Authfile creates the basepath multiple times -- possible an origin advertisement issue #818

Closed turetske closed 8 months ago

turetske commented 8 months ago

Pelican Version: 7.5.6

Pelican Service:

Describe the bug When serving a cache and an origin, if the cache waits a bit after the origin has been served, the sci-tokens authfile creates repeated paths.

Example:

audience_json = ["https://70fa1e4d6777:8443"]

[Issuer https://70fa1e4d6777:8443]
issuer = https://70fa1e4d6777:8443
base_path = /turetsky-test0, /turetsky-test0, /turetsky-test0, /turetsky-test0, /turetsky-test0

To Reproduce Serve a pelican origin:

./pelican origin serve -p <port> -v <volume>:<namespace>

Wait a bit, ~10 minutes

Serve a pelican cache:

./pelican cache serve -p <port>

Then view the cache's generated scitokens file.

Expected behavior

Even if the origin advertises multiple times, the namespace shouldn't be repeated, either in the director or the cache. So it should look like:

audience_json = ["https://70fa1e4d6777:8443"]

[Issuer https://70fa1e4d6777:8443]
issuer = https://70fa1e4d6777:8443
base_path = /turetsky-test0

Desktop (please complete the following information):

Additional context While this is showing up in the cache, I suspect it's an issue with the director and the periodic re-advertisement. Either in the cache or the origin.

Since duplicating the namespace doesn't break anything, everything still functions as normal, it is a growing memory issue.

turetske commented 8 months ago

Assigning this to Haoming if only because I'm pretty sure his current PR is already closing it.

haoming29 commented 8 months ago

Yes. I confirmed that with the fix in #852, authfile in cache has no duplicated namespaces