spin icon indicating copy to clipboard operation
spin copied to clipboard

HTTP Component Timeout

Open jaime-amate opened this issue 2 years ago • 3 comments

Hi!

First I'd like to praise the project, pretty cool stuff :)

I'd like to know if there's a way to timeout an HTTP component after a defined amount of time. I have a CPU-bound operation on user data that may even lead to an 'infinite' loop.

jaime-amate avatar Dec 04 '23 20:12 jaime-amate

Hi @jaime-amate, thanks for the kind words! Alas, there currently isn't any native support in the Spin for configuring a timeout for a component. The component itself would need to implement this logic.

I do see a related issue (though broader/more vague in scope) in https://github.com/fermyon/spin/issues/30. The request here seems to align with item 1 mentioned in https://github.com/fermyon/spin/issues/30#issuecomment-1074354557. Feel free to relay any further notes around your use case either here or in https://github.com/fermyon/spin/issues/30. This issue may be a great excuse to split out the thoughts in #30 into distinct features/functionality!

vdice avatar Dec 06 '23 00:12 vdice

Hi just came across this, does this mean a component would always continue execution unless shut down manually?

chokosabe avatar Jul 18 '24 19:07 chokosabe

It used to be the case that if a client cancelled a request then the component execution would stop, but reviewing the code now I think that may no longer necessarily be the case. An optional component timeout would certainly make sense to me.

lann avatar Jul 18 '24 19:07 lann