Skip to content
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

exceptions: explicitly catch and throw OutOfMemoryException #380

Merged
merged 1 commit into from
Oct 15, 2023

Conversation

mfkl
Copy link
Contributor

@mfkl mfkl commented Oct 13, 2023

No description provided.

Copy link
Contributor

@marcin-krystianc marcin-krystianc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried it and looks good 👍
An example stack trace in case of bad_alloc exception looks like this:

 Error Message:
   System.OutOfMemoryException : bad allocation
  Stack Trace:
     at ParquetSharp.ExceptionInfo.Check(IntPtr exceptionInfo) in d:\workspace\ParquetSharp\csharp\ExceptionInfo.cs:line 33
   at ParquetSharp.ExceptionInfo.Return[TValue](IntPtr handle, GetFunction`1 getter) in d:\workspace\ParquetSharp\csharp\ExceptionInfo.cs:line 74
   at ParquetSharp.ExceptionInfo.Return[TValue](ParquetHandle handle, GetFunction`1 getter) in d:\workspace\ParquetSharp\csharp\ExceptionInfo.cs:line 67
   at ParquetSharp.ColumnReader.get_HasNext() in d:\workspace\ParquetSharp\csharp\ColumnReader.cs:line 68
   at ParquetSharp.LogicalBatchReader.DirectReader`2.ReadBatch(Span`1 destination) in d:\workspace\ParquetSharp\csharp\LogicalBatchReader\DirectReader.cs:line 23
   at ParquetSharp.LogicalColumnReader`3.ReadBatch(Span`1 destination) in d:\workspace\ParquetSharp\csharp\LogicalColumnReader.cs:line 199
   at ParquetSharp.LogicalColumnReader`1.ReadBatch(TElement[] destination, Int32 start, Int32 length) in d:\workspace\ParquetSharp\csharp\LogicalColumnReader.cs:line 163
   at ParquetSharp.RowOriented.ParquetRowReader`1.ReadColumn[TValue](Int32 column, TValue[] values, Int32 length) in d:\workspace\ParquetSharp\csharp\RowOriented\ParquetRowReader.cs:line 66
   at lambda_method200(Closure, ParquetRowReader`1, Row1[], Int32)
   at ParquetSharp.RowOriented.ParquetRowReader`1.ReadRows(Int32 rowGroup) in d:\workspace\ParquetSharp\csharp\RowOriented\ParquetRowReader.cs:line 55
   at ParquetSharp.Test.TestRowOrientedParquetFile.TestWriteMultipleBatches(Boolean useSpan) in d:\workspace\ParquetSharp\csharp.test\TestRowOrientedParquetFile.cs:line 363
   at InvokeStub_TestRowOrientedParquetFile.TestWriteMultipleBatches(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

Copy link
Contributor

@adamreeve adamreeve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me thanks @mfkl

@adamreeve adamreeve merged commit 7e22bef into G-Research:master Oct 15, 2023
26 checks passed
@mfkl mfkl deleted the oom branch October 16, 2023 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants