azure service fabric - Increase timeout for RunAsync -
i creating number of service bus clients in runasync method on statefull service.
the method takes longer 4 seconds allowed when running in development environment , application fail start.
it fails because of appears latency between dev machine , azure.
i in thailand. azure in south central us.
can 4000 millisecond timeout increased locally on dev box?
the error is:
{ { "message": "runasync has been cancelled stateful service replica. cancellation considered 'slow' if runasync not halt execution within 4000 milliseconds. "level": "informational", "keywords": "0x0000f00000000000", "eventname": "statefulrunasynccancellation", "payload": { [...] "slowcancellationtimemillis": 4000.0
} }
the problem not runasync
takes long run, it's takes long cancel.
service fabric has default (hard-coded) timeout 4 seconds reporting "slow" cancellations. means after time produce health event (which may important during upgrades affects health status of entire application).
the real problem implementation of runasync
. when remove service or upgrade one, service fabric wait (potentially forever) shut down gracefully. code should respect cancellationtoken
passed runasync
method. example, if have multiple io operations, call cancellationtoken.throwifcancellationrequested()
after each 1 (whenever possible) , pass method accepts parameter.
Comments
Post a Comment