kubeless icon indicating copy to clipboard operation
kubeless copied to clipboard

Function doesn't timeout using java runtime

Open roversnord opened this issue 2 years ago • 0 comments

Is this a BUG REPORT or FEATURE REQUEST?:

What happened: Created a kubeless function using java runtime with a timeout of 10 and the java code having a sleep for 30 seconds.

What you expected to happen: After 10 seconds the function should timeout. Instead the function finishes successfully after the 30 seconds sleep is complete in the java code

How to reproduce it (as minimally and precisely as possible): Function code using java. package io.kubeless; import io.kubeless.Event; import java.util.Date; import io.kubeless.Context; public class Wo { public String example (Event event, Context context) throws InterruptedException { System.out.println(new Date() + " Starting..."); long start = System.currentTimeMillis(); Thread.sleep(30000); long end = System.currentTimeMillis(); return "Duration: " + (end-start)/1000 + ", Message: Hello world!"; } }

function creation using kubeless: kubeless function deploy java-timeout --timeout=10 --runtime java1.8 --handler Wo.example --from-file Wo.java

function logs: $ kubeless function logs -f java-timeout Mon Oct 11 16:43:06 UTC 2021 Starting... 0 [pool-1-thread-9] INFO io.kubeless.Handler - Response: Duration: 30, Message: Hello world!

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version): Client - 1.21.4, Server: 1.18.9
  • Kubeless version (use kubeless version): 1.0.8
  • Cloud provider or physical cluster: physical cluster

roversnord avatar Oct 11 '21 17:10 roversnord