keboola / db-extractor-mssql

MIT License
1 stars 2 forks source link

Throw reconnection error as user error #135

Closed pivnicek closed 5 years ago

pivnicek commented 5 years ago

fixes #130

pivnicek commented 5 years ago

hmmm, yes, you may be right. I wonder if the ideal solution may be to wrap the tryReconnect in a retryProxy that throws UserException if it eventually fails, I'll update this. Thanks

pivnicek commented 5 years ago

Maybe the retry should be low level - making the extractor entirely oblivious to the fact that the underlying code does not fail immediately, but only after the retries are exhausted

Yes, that was kind of the idea with the runRetryableQuery method. This inner retry on reconnect is internal to that method though. I suppose we could extract that method to db-ex-common, or to the db-ex-retry wrapper package if that's the way we want to bundle it.