-
Notifications
You must be signed in to change notification settings - Fork 342
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
Implement ODELAY option #491
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is off to a good start! I think scoping it to a few targets for the first implementation is a good way to start.
Rather than performing the checks and open calls in the sendto
functions, I would prefer to see support added to stumpless_open_target
and stumpless_target_is_open
for these target types. stumpless_add_entry
can then check the options on the target and these functions to see if ODELAY
is set and attempt to open the target if appropriate.
This will allow users to have finer-grained control over precisely when a target is opened, using the same functionality that would need to be implemented anyway. If they don't want to tune this functionality, then it will happen automatically in stumpless_add_entry
and they won't need to do anything other than set the option.
It'll also keep you from needing to make too many changes to the semantics of the sendto functions, like changing parameters, who holds what locks, etc.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## latest #491 +/- ##
==========================================
- Coverage 90.63% 90.62% -0.02%
==========================================
Files 47 47
Lines 4433 4501 +68
Branches 592 601 +9
==========================================
+ Hits 4018 4079 +61
- Misses 272 277 +5
- Partials 143 145 +2 ☔ View full report in Codecov by Sentry. |
@goatshriek : I think I have fixed all the other errors except windows build. There aren't any details in workflow logs to understand what is going wrong. Can you help me with how to proceed here? |
From the build log it looks like the socket include added to |
Thanks for your help and patience with this PR! I believe all workflow checks should pass now (maybe except coverage). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on this! There are a number of tweaks outlined below, after which this should be good to merge.
The line which I removed in this commit was added previously when I was closing the target on failure. Since close_target was removed, this assertion should have failed everytime but somehow it did not fail in linux and windows checks which seems a little strange to me. |
I'm not completely sure why that assertion was passing, as you're correct that it shouldn't. I will make a separate point to go look into that. It does raise a point that probably needs clarification in the documentation though - that the current target will be set by an open call even if |
Thanks again for putting this together and sticking with the update through the requested changes! Excellent work. |
Issue #80.
Approach
Used an atomic variable to store default option and exposed two functions (setter and getter) to modify/retrieve the options. This allows initializing the target with certain options as ODELAY requires it be passed before target is created.
Benefits to this approach:
Targets covered:
Targets pending:
Targets not applicable: