File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,15 @@ namespace facebook::velox::common {
34
34
" {}" , \
35
35
errorMessage);
36
36
37
+ #define VELOX_GENERIC_SPILL_FAILURE (errorMessage ) \
38
+ _VELOX_THROW ( \
39
+ ::facebook::velox::VeloxRuntimeError, \
40
+ ::facebook::velox::error_source::kErrorSourceRuntime .c_str(), \
41
+ ::facebook::velox::error_code::kGenericSpillFailure .c_str(), \
42
+ /* isRetriable */ true , \
43
+ " {}" , \
44
+ errorMessage);
45
+
37
46
// / Defining type for a callback function that returns the spill directory path.
38
47
// / Implementations can use it to ensure the path exists before returning.
39
48
using GetSpillDirectoryPathCB = std::function<std::string_view()>;
Original file line number Diff line number Diff line change @@ -109,6 +109,9 @@ inline constexpr auto kNoCacheSpace = "NO_CACHE_SPACE"_fs;
109
109
// / An error raised when spill bytes exceeds limits.
110
110
inline constexpr auto kSpillLimitExceeded = " SPILL_LIMIT_EXCEEDED" _fs;
111
111
112
+ // / An error raised to indicate any general failure happened during spilling.
113
+ inline constexpr auto kGenericSpillFailure = " GENERIC_SPILL_FAILURE" _fs;
114
+
112
115
// / An error raised when trace bytes exceeds limits.
113
116
inline constexpr auto kTraceLimitExceeded = " TRACE_LIMIT_EXCEEDED" _fs;
114
117
Original file line number Diff line number Diff line change @@ -133,7 +133,12 @@ void SpillState::setPartitionSpilled(uint32_t partition) {
133
133
void SpillState::validateSpillBytesSize (uint64_t bytes) {
134
134
static constexpr uint64_t kMaxSpillBytesPerWrite =
135
135
std::numeric_limits<int32_t >::max ();
136
- VELOX_CHECK_LT (bytes, kMaxSpillBytesPerWrite , " Spill bytes will overflow." );
136
+ if (bytes >= kMaxSpillBytesPerWrite ) {
137
+ VELOX_GENERIC_SPILL_FAILURE (fmt::format (
138
+ " Spill bytes will overflow. Bytes {}, kMaxSpillBytesPerWrite: {}" ,
139
+ bytes,
140
+ kMaxSpillBytesPerWrite ));
141
+ }
137
142
}
138
143
139
144
void SpillState::updateSpilledInputBytes (uint64_t bytes) {
You can’t perform that action at this time.
0 commit comments