-
Notifications
You must be signed in to change notification settings - Fork 556
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
Remove s3 WSClient. Replace with S3 API #18359
Conversation
import scala.concurrent.{ExecutionContext, Future} | ||
|
||
trait FrontJsonFapi extends Logging { | ||
lazy val stage: String = Configuration.facia.stage.toUpperCase | ||
val bucketLocation: String | ||
val parallelJsonPresses = 16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increasing to 16 after seeing sporadic exceptions in prod with a low threshold of 8.
PRbuilds results: Screenshots 💚 Exceptions 💚 A11y validation Apache Benchmark Load Testing 💚 Microdata Validation --automated message |
pressedPageFromS3(getAddressForPath(path, "json")) | ||
} | ||
|
||
private def pressedPageFromS3(path: String)(implicit executionContext: ExecutionContext): Future[Option[PressedPage]] = errorLoggingF(s"FrontJsonFapi.pressedPageFromS3 $path") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this private methode necessary? Can its content be moved into get
above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be
log.warn("Could not parse JSON in FrontJson") | ||
None | ||
} | ||
FaciaPressMetrics.FrontDecodingLatency.recordDuration(stopWatch.elapsed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep this metric recording?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will put it back
Seen on PROD (merged by @QuarpT 25 minutes and 7 seconds ago)
|
What does this change?
Removes the custom S3 WSClient - it's only used in one place and seems unnecessary. The difference is that WSClient is non-blocking - so I've wrapped the amazon API in blocking operations thread pool.
If we want to avoid using the native Java Amazon API, then we should use https://developer.lightbend.com/docs/alpakka/current/s3.html rather than implement our own http client.
What is the value of this and can you measure success?
Simplifies retrieving facia fronts
Tested in CODE?
I will