Skip to content
Snippets Groups Projects
Commit da1892a9 authored by Nikita Pettik's avatar Nikita Pettik Committed by Vladimir Davydov
Browse files

box/iproto: introduce reqstart to iproto_msg

Previously we decided to pass `msg->p_inbuf->rpos` to flight recorder in
order to dump request. However, this is wrong way to do it since `rpos`
is moved only request has been processed, i.e. at the same moment several
requests may have the same `rpos` value. To fix this let's save the start
of unparsed request to `iproto_msg`. There's one detail that should be
clarified to understand that in this case we'll always get valid
pointer to ibuf. Imagine following state of ibuf:
```
+_____________________
|   |  |          |
+---------------------
    ^  ^          ^
  RPOS R2       WPOS
   R1
```
R1 is the first request in the buffer (i.e. rpos points to it);
R2 is the second. One can argue that if R2 is processed faster than R1
than during the dump of R1 its `reqstart` may point to the garbage.
However, dump of request takes place at the bery beginning of request
execution in TX thread. As far as messages are started to be processed
exactly in the same way as they were received, then R1 will be always
dumped before R2 and its further processing.

Follow-up 247515e9

NO_DOC=<No user visible changes>
NO_TEST=<No functional changes>
NO_CHANGELOG=<No functional changes>
parent e73ca8a5
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment