SlideRuleEarth / sliderule

Server and client framework for on-demand science data processing in the cloud
https://slideruleearth.io
Other
27 stars 12 forks source link

Lua endpoints have failure case bugs in them #107

Open jpswinski opened 2 years ago

jpswinski commented 2 years ago

Some Lua endpoints have logic bugs in their failure case handling that hasn't been caught yet because we have not hit the failure cases.

The code needs to be fixed, but there also needs to be tests written to hit these failure cases and verify that the fixes are working.

Here are some where userlog has not been defined:

https://github.com/ICESat2-SlideRule/sliderule/blob/019d660d9f48f8acdcb1b20bf329179202414462/scripts/endpoints/h5.lua#L34-L37

https://github.com/ICESat2-SlideRule/sliderule/blob/019d660d9f48f8acdcb1b20bf329179202414462/scripts/endpoints/h5p.lua#L38-L41

Also, need to check if the param table is not nil because an invalid json string could cause it to return empty.

jpswinski commented 2 years ago

The self test test_luaerror.py is failing because of the premature termination of the connection due to the overflow of the client request buffers.