1

I'm testing a new SWF workflow, and I've got some activity that makes a RESTful call out to another service. Problem is, I can see through logging that the actual call takes less than a second to complete, but the Activity always times out in SWF (START_TO_CLOSE of 5 mins). Being more specific, the RESTful call is a list call, and when I limit the batch size to a small number, the Activity completes and moves on very quickly. But at some seemingly arbitrary threshold, it chokes completely.

Does anyone have any insight into this? I've read that SWF calls have a size limitation of 1 MB, does anyone know how to find the size of data my workers are trying to pass SWF?

jayjyli
  • 771
  • 3
  • 11
  • 23

2 Answers2

1

After some remote debugging, it turns out the response from the task is too big and the activity is failing silently. The failure occurs when the framework tries to report the response back to SWF, and the SDK calls RespondActivityTaskCompleted. That API has a length restriction on the internal result param:

Length Constraints: Maximum length of 32768.

This is a validation error that throws an uncaught exception and is swallowed internally until the Activity times out.

jayjyli
  • 771
  • 3
  • 11
  • 23
1

I wouldn't recommend using activity input and output parameters for passing large data sets. SWF is an orchestration technology, not the data passing one. The standard workarounds are:

  • Storing result in a separate store (S3 for example) and passing reference to it.
  • Caching result locally on a machine and route all following activities to the same host for them to have access to the cached result. See fileprocessing sample for the details of routing approach.

BTW. Have you checked out Cadence which is an open source version of SWF with much better client side libraries?

Maxim Fateev
  • 6,458
  • 3
  • 20
  • 35
  • Yes, I got around the problem by passing around object references rather than the object themselves. As for Cadence, this is a new workflow as part of an existing service that has already onboarded with SWF, but thanks for the suggestion! – jayjyli Jul 19 '18 at 23:55