fnproject / fdk-java

Java API and runtime for fn.
Apache License 2.0
142 stars 53 forks source link

Logging is not always emitted when the function fails during startup #245

Closed zootalures closed 3 years ago

zootalures commented 3 years ago

Logs are sometimes not emitted for failures that occur within function initialization - this means that errors related to:

Are not logged

It think this is caused by two things:

This change defers initialization of the function Runtime context until the first event is received, ensuring that initialization errors are logged, and also moves log framing out of the method invoker and up to the function entrypoint.

This also keeps the JVM alive if there is an error in initalization.