feat: try to use the S3 tiles version if available instead of returning 503#126
Open
juanmahidalgo wants to merge 3 commits intomasterfrom
Open
feat: try to use the S3 tiles version if available instead of returning 503#126juanmahidalgo wants to merge 3 commits intomasterfrom
juanmahidalgo wants to merge 3 commits intomasterfrom
Conversation
Pull Request Test Coverage Report for Build 13368654260Details
💛 - Coveralls |
LautaroPetaccio
approved these changes
Feb 18, 2025
| * Checks if the S3 redirect feature flag is enabled | ||
| */ | ||
| const isS3RedirectEnabled = async (features: IFeaturesComponent) => { | ||
| return await features.getIsFeatureEnabled( |
Contributor
There was a problem hiding this comment.
Suggested change
| return await features.getIsFeatureEnabled( | |
| return features.getIsFeatureEnabled( |
| const result = await handler({ url: new URL('http://localhost') }) as HandlerResponse | ||
| expect(result.status).toBe(200) | ||
| expect(loggerWarnMock).toHaveBeenCalledWith('No S3 file available') | ||
| expect(result.headers?.['content-type']).toBe('application/json') |
Contributor
There was a problem hiding this comment.
This line, which is used in all tests that assert that the tiles are returned is not making sure the tiles are being returned as expected, as it only checks that the response is of type application/json. Would you mind changing the assertion to do so?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Atlas Server - S3 Redirect Enhancement
Context
Currently, when the map is not ready, the server returns a 503 status code. However, we have a feature flag that allows redirecting to S3 where we store cached versions of the tiles. This PR enhances the logic to use S3 redirects when available, even when the map is not ready.
In addition, the PR includes:
run.startmethod of the map component in case some of it's logic throws an error. It will try 10 times to start the service.E.g of an error seen that didn't let the component to start:
[ERROR] (Map component): Failed to initialize map component: Error: Error fetching rentals, the server responded with: 502 "Failed to initialize map component: Error: Error fetching rentals, the server responded with: 502"Changes
createTilesRequestHandlerandcreateLegacyTilesRequestHandler) to:Logic Flow
When map is not ready:
When map is ready:
Testing
Added comprehensive test suite covering all possible combinations of:
Benefits