dotnet / dotnet/extensions

[AI Evaluation] Gracefully handle invalid or corrupted cache entries when running `cleanCache`

Open
#6,151 0 comments 0 reactions 1 assignee Claimed by @peterwald View on GitHub
area-ai-eval
Dominant language
C#
Stars
3.2k
Forks
894
Avg merge
1d 12h
Merged PRs (30d)
23

Description

Exception encountered when running against Azure Data Lake

```
System.Text.Json.JsonException: The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
---> System.Text.Json.JsonReaderException: The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. LineNumber: 0 | BytePositionInLine: 0.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)
at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.DeserializeAsync(Stream utf8Json, CancellationToken cancellationToken)
at Microsoft.Extensions.AI.Evaluation.Reporting.Storage.AzureStorageResponseCache.CacheEntry.ReadAsync(DataLakeFileClient fileClient, CancellationToken cancellationToken) in C:\src\extensions\src\Libraries\Microsoft.Extensions.AI.Evaluation.Reporting.Azure\Storage\AzureStorageResponseCache.CacheEntry.cs:line 62
at Microsoft.Extensions.AI.Evaluation.Reporting.Storage.AzureStorageResponseCache.DeleteExpiredEntriesAsync(DataLakeDirectoryClient client, Func`1 provideDateTime, CancellationToken cancellationToken) in C:\src\extensions\src\Libraries\Microsoft.Extensions.AI.Evaluation.Reporting.Azure\Storage\AzureStorageResponseCache.cs:line 249
at Microsoft.Extensions.AI.Evaluation.Reporting.Storage.AzureStorageResponseCache.DeleteExpiredEntriesAsync(DataLakeDirectoryClient client, Func`1 provideDateTime, CancellationToken cancellationToken) in C:\src\extensions\src\Libraries\Microsoft.Extensions.AI.Evaluation.Reporting.Azure\Storage\AzureStorageResponseCache.cs:line 242
at Microsoft.Extensions.AI.Evaluation.Console.Utilities.LoggerExtensions.ExecuteWithCatchAsync(ILogger logger, Func`1 action, Boolean swallowUnhandledExceptions) in C:\src\extensions\src\Libraries\Microsoft.Extensions.AI.Evaluation.Console\Utilities\LoggerExtensions.cs:line 133
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.