azure-functions-java-worker icon indicating copy to clipboard operation
azure-functions-java-worker copied to clipboard

grpc java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: CANCELLED: Client sendMessage() failed with Error

Open amamounelsayed opened this issue 6 years ago • 4 comments

The worker randomly restart using the blobInput httptrigger and bloboutput. The httptrigger uses header not body.

amamounelsayed avatar Dec 21 '19 00:12 amamounelsayed

The issue that grp-java is overwhelmed by the number of the requests which cause the crash. Still investigating if the cause from host or from the java.

@FunctionName("HttpTrigger-Java") public HttpResponseMessage run( @HttpTrigger(name = "req", methods = {HttpMethod.GET, HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage<Optional<String>> request, final ExecutionContext context) throws Exception{ context.getLogger().info("Java HTTP trigger processed a request. 1");

 //   get("https://httpstat.us/200");

    // Parse query parameter
    String query = request.getQueryParameters().get("name");
    String name = request.getBody().orElse(query);

    for(int i=0; i<1000000; i++) {
        context.getLogger().fine("Java HTTP trigger processed a request");
    }

    context.getLogger().info("Java HTTP trigger processed a request. 2");

    if (name == null) {
        return request.createResponseBuilder(HttpStatus.BAD_REQUEST).body("Please pass a name on the query string or in the request body").build();
    } else {
        return request.createResponseBuilder(HttpStatus.OK).body("Hello, " + name).build();
    }
}

amamounelsayed avatar Feb 10 '20 18:02 amamounelsayed

Any updates on this. I am also facing this error when running azure functions

meeraeldhose avatar Sep 09 '21 19:09 meeraeldhose

Any updates

parineetha888 avatar Oct 21 '21 11:10 parineetha888

Thank you for your message, we implemented new feature for better logging, instead of using the context logging. https://github.com/Azure/azure-functions-java-worker/wiki/Distributed-Tracing-for-Java-Azure-Functions https://docs.microsoft.com/en-us/azure/azure-monitor/app/monitor-functions

amamounelsayed avatar Oct 21 '21 15:10 amamounelsayed