siilisolutions / hedge

a serverless solution for clojure
Eclipse Public License 1.0
39 stars 6 forks source link

bug: azure/deploy-to-directory uses optimisation that can cause issues #117

Closed erkkikeranen closed 6 years ago

erkkikeranen commented 6 years ago

The case:

When using boot task azure/deploy-to-directory with multiple functions (that uses outputs bindings) do not work when deployed with azure/deploy-from-directory.

The reason is probably the difference that:

Hedge catches an error that bindings. cannot be accessed when handler tries to write output atoms to context.bindings.

2018-02-21T06:53:30.309 [Error] ERROR [hedge.azure.function-app:166] - 
Error: Oops, Missing expected object key 'stubcalls' on key path 'bindings.stubcalls'
2018-02-21T06:53:30.449 [Error] Exception while executing function: Functions.stub_core__view-tribes. mscorlib: Error: Oops, Missing expected object key 'stubcalls' on key path 'bindings.stubcalls'
    at Error (native)
    at hedge.azure.function_app.outputs__GT_bindings (D:\home\site\wwwroot\stub_core__view-tribes\index.js:7278:377)
    at D:\home\site\wwwroot\stub_core__view-tribes\index.js:7285:428
    at D:\home\site\wwwroot\stub_core__view-tribes\index.js:7308:361
    at D:\Program Files (x86)\SiteExtensions\Functions\1.0.11535\bin\azurefunctions\functions.js:106:24.
2018-02-21T06:53:30.512 [Error] Function completed (Failure, Id=6c81909c-be9a-4a1b-80f1-727f4cdf3c4b, Duration=2406ms)

Other facts are that simple creates bloaty functions of 3 megabytes, which seem to stagger azure portal responsivity, whereas advanced optimises to around 500kb. There is no big difference in memory usage (see also #114) or compilation time.

Workaround : use -O advanced in conjunction with azure/deploy-to-directory