Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move calls to Initialize above Timeout token #329

Merged
merged 1 commit into from
Jul 4, 2023
Merged

Move calls to Initialize above Timeout token #329

merged 1 commit into from
Jul 4, 2023

Conversation

timyhac
Copy link
Collaborator

@timyhac timyhac commented Feb 5, 2023

Currently, as discovered in #327, when using ReadAsync or WriteAsync without first making a call to InitializeAsync and the initialization fails - the exception thrown is of type TaskCancelledException - not LibplctagException.

If I recall correctly, the intention was to throw a LibplctagException for the libplctag.NET async timeouts, and only to throw a TaskCancelledException if the supplied token is cancelled,

One issue with the attached patch is that there is now two separate timeouts - one for the Initialization, and a second one for the Read - so if there is a 10 second timeout, and a 9 second latency on operations - it will successfully complete in 2*9seconds=18seconds -> maybe the library consumer is expected it to timeout because 18 seconds is larger than the configured timeout.

Either way, this is an API-breaking change so will require some sort of version bump.

@timyhac timyhac merged commit 68bc9b2 into master Jul 4, 2023
@timyhac timyhac deleted the #327 branch July 4, 2023 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant