-
Notifications
You must be signed in to change notification settings - Fork 211
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
PROTON-2275: Fixed idle_timeout connection option not working for SSL connections on Windows. #255
base: main
Are you sure you want to change the base?
Conversation
@astitcher @jiridanek : Is there anything I can do to make sure this gets merged soon? |
A start would be to create a JIRA to allow tracking the issue, rebasing your commit against master (rather than merging master), and reference the JIRA in your commit (see existing commits). |
24cf576
to
09e6e3e
Compare
@gemmellr It's done. |
Thanks. Hopefully one of the C-inclined folks will be along to review the change. |
Hi @gemmellr. I've come across the same issue using version 0.37.0 through vcpkg (happened to be the version I had installed, and I couldn't see any changes related to this in newer versions). I applied this little fix and it seems to work a treat. Any chance this could be reviewed soon? |
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.
I'm not sure that this fix is in the correct layer, as the openssl code works correctly (it does right?)
// This is to match the behaviour of pn_output_write_amqp defined in transport.c. | ||
// Without this, the idle_timeout connection option does not work in case of an SSL connection. | ||
if (!pn_buffer_size(transport->output_buffer) && transport->close_sent) { | ||
return PN_EOS; | ||
} | ||
|
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.
I'm somewhat confused about this change - the equivalent openssl code does not do anything like this but as far as I know works correctly in the face of idle timeout. This makes me think that this is not the correct fix to the problem.
Especially as the check should be redundent in that the amqp layer processing which does have this check will still be running and should pick up on the issue. Clearly there is an issue somewhere that is specific to the schannel implementation, but this seems like a 'voodoo' fix.
@cliffjansen @kgiusti do either of you have any thoughts?
Steps to reproduce:
idle_timeout
connection option to e.g. 2 seconds in yourproton::messaging_handler
instance.on_message
callback, sleep for longer thanidle_timeout
. This should trigger theon_transport_error
callback with aamqp:resource-limit-exceeded: local-idle-timeout expired
error. On Windows this does not happen.I saw that the above scenario worked correctly when connecting to a non-SSL broker but failed with an SSL broker. I looked at the difference between the two code paths and found that for the same input (
transport->output_buffer
being empty andtransport->close_sent == true
)transport.c
returnsPN_EOS
whileschannel.c
returned0
. After ensuring thatschannel.c
matches the behaviour oftransport.c
, the problem went away.