Repository navigation
Conversation
Motivation: The upload directives always use FileIO.toPath. On the supported Pekko Streams implementation the materialized Future already fails on file and upstream I/O errors, so repeating the IOResult check adds an unnecessary callback. Modification: Use the materialized result directly for single and multiple file uploads. Keep existing failure propagation, cleanup and ordering, and cover file-open failures at the actual routing entry points. Result: Focused FileUploadDirectivesSpec tests pass 33/33 on each Scala axis. Failed file opens still reach the exception handler with the original I/O cause without entering the application route. No public API change or throughput claim. References: Pekko Streams FileIO.toPath and FileOutputStage.
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.
Motivation
The upload directives always use FileIO.toPath. On the supported Pekko Streams implementation the materialized Future already fails on file and upstream I/O errors, so repeating the IOResult check adds an unnecessary callback.
Modification
Use the materialized result directly for single and multiple file uploads. Keep existing failure propagation, cleanup and ordering, and cover file-open failures at the actual routing entry points.
Result
The real
FileUploadDirectivesSpecpassed 33/33 on each of Scala 2.13.18 and 3.3.9 (JDK 17, Pekko Core 2.0.0). The original implementation passed the same suite, and a negative control that swallowed file-open failures failed both new cases. Checked formatting; no public API change or benchmark claim. Targeted ScalaTest runs recompiled the changed source and suite against the local module classpath; a complete sbt run is not claimed.References
Pekko Streams FileIO.toPath and FileOutputStage.