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

[#237] Reset one more connection-related state information (missed out in #136) soon after connection gets reset #239

Merged
merged 1 commit into from
May 8, 2018

Conversation

nars1
Copy link
Collaborator

@nars1 nars1 commented May 8, 2018

Issue #136 moved all state related information in gtmrecv_poll_actions.c into a structure
variable "curr_conn_state". But there was another global variable "gtmrecv_send_cmp2uncmp"
which was set in gtmrecv_process.c and was the same as "curr_conn_state.send_cmp2uncmp"
which meant whenever "curr_conn_state.send_cmp2uncmp" got cleared (due to the memset
changed introduced in #136), "gtmrecv_send_cmp2uncmp" should have also been cleared.
Not doing so, meant it was still possible for a stale old connection related state
variable to be carried over to a new connection resulting in an assert failure in the
source server in rare cases (just like #136) in dbg or a connection loss and reconnect
sequence in pro (this did happen in one in-house test failure). This is now fixed
so both variables are kept in sync.

It was originally thought of avoiding the duplication and replacing all usages of
"gtmrecv_send_cmp2uncmp" with "curr_conn_state.send_cmp2uncmp" but it was not trivial
due to the need to move the "conn_state_t" type definition from gtmsource_poll_actions.c
into a header file so gtmrecv_process.c can also inherit that definition. And since this
is an edge case, and there was a risk of other subtle regressions, the trivial change
was adopted even though it is not as desirable.

…ssed out in YottaDB#136) soon after connection gets reset

Issue YottaDB#136 moved all state related information in gtmrecv_poll_actions.c into a structure
variable "curr_conn_state". But there was another global variable "gtmrecv_send_cmp2uncmp"
which was set in gtmrecv_process.c and was the same as "curr_conn_state.send_cmp2uncmp"
which meant whenever "curr_conn_state.send_cmp2uncmp" got cleared (due to the memset
changed introduced in YottaDB#136), "gtmrecv_send_cmp2uncmp" should have also been cleared.
Not doing so, meant it was still possible for a stale old connection related state
variable to be carried over to a new connection resulting in an assert failure in the
source server in rare cases (just like YottaDB#136) in dbg or a connection loss and reconnect
sequence in pro (this did happen in one in-house test failure). This is now fixed
so both variables are kept in sync.

It was originally thought of avoiding the duplication and replacing all usages of
"gtmrecv_send_cmp2uncmp" with "curr_conn_state.send_cmp2uncmp" but it was not trivial
due to the need to move the "conn_state_t" type definition from gtmsource_poll_actions.c
into a header file so gtmrecv_process.c can also inherit that definition. And since this
is an edge case, and there was a risk of other subtle regressions, the trivial change
was adopted even though it is not as desirable.
@nars1 nars1 self-assigned this May 8, 2018
@nars1 nars1 requested a review from estess May 8, 2018 15:23
@nars1 nars1 merged commit e2ded96 into YottaDB:master May 8, 2018
@nars1 nars1 deleted the cmp2uncmp branch May 8, 2018 16:54
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.

2 participants