Azure / Azure/azure-functions-java-worker

OutOfMemory exception when passing file larger than 4MB

オープン
#254 コメント 1 件 リアクション 0 件 担当者 1 名 @kamperiadis が担当を希望しています GitHub で見る
area:java-functions Bug needs-investigation reviewed
主要言語
Java
スター
103
フォーク
74
平均マージ
4日 8時間
マージ済み PR(30日)
2

説明

I have an HttpTrigger function that receives multipart/form-data content. When a file greater than 4MB is passed to the function it errors out with `502 - Web server received an invalid response while acting as a gateway or proxy server`. In the Azure logs I see `Exception of type 'System.OutOfMemoryException' was thrown.` When I run the function locally I don't have any problems processing a larger file. I have only see the error occur when I run the deployed function. I found a closed issue that seems related https://github.com/Azure/azure-functions-java-worker/issues/70

#### Investigative information

- Timestamp: 2018-12-14T16:19:00.832
- Invocation ID: Id=99214fd3-9aff-4238-9dba-f50bc77b6128
- Region: West US
- Function Runtime Version: 2.0.12210.0
- azure-functions-java-library version: 1.2.0
- azure-functions-maven-plugin version: 1.2.0

#### Repro steps

1. Run the function with a file that is larger than 4 MB.

#### Expected behavior

Function does not timeout on larger files.

#### Actual behavior

Deployed function is not executed and error out with an OutOfMemory exception and returns `502 - Web server received an invalid response while acting as a gateway or proxy server.`

#### Known workarounds

None.

#### Related information
Here is a snippet of the function having the issue:

Source

```java
@FunctionName("BitSplit")
public HttpResponseMessage bitSplit(
@HttpTrigger(name = "content", methods = {HttpMethod.POST}, authLevel = AuthorizationLevel.FUNCTION, dataType = "binary") HttpRequestMessage> request,
final ExecutionContext context
) {
try {
RequestContextWrapper requestContext = new RequestContextWrapper(request);
MultipartProcessor multipartProcessor = new MultipartProcessor();
List formItems = multipartProcessor.readFormData(requestContext);
}
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。