#205 Non-blocking IO + Extended request debug logging
Merged by cipherboy. Opened by cipherboy.
cipherboy/gssproxy nonblocking  into  master

Download 205.patch

This converts client socket requests to use O_NONBLOCK in order to
add timeout functionality. The current timeout window three periods
of 15 seconds each. Upon failure, ETIMEDOUT is returned. If reading a
request times out, the entire request is retried.

This also adds extended logging on the server in level=3, allowing requests
and responses to be tracked through reading, decoding, encoding the reply,
and writing.

rebased

rebased

  • None of your debug statements are wrapped to 78 characters; please fix.
  • Please also reflow your commit bodies to 72 characters; more information on this formatting convention can be found here.
  • The epoll gunk currently in gpm_make_call should be in its own helper function.
  • Non-blocking commit message is misleading; it is send and recv together, not individually, that hit the retry limit.
  • Typo; "will be expose to the caller"
  • Please use less of if (func(foo) == val) and reuse more temp vars (there's usually one lying around in the function already)

re: epoll gunk, are you referring to the gssproxy socket retry or the entire loop? I broke the socket retry logic into another function, but if you want the loop too, that's possible as well.

Otherwise, updated. Sorry about widths.

(there's one remaining if (func(foo) == val), but that's because the call would then clobber ret. Do you want me to introduce another temp variable?)

rebased

Pagure decided to eat my email, so:

re: epoll gunk, are you referring to the gssproxy socket retry or the
entire loop? I broke the socket retry logic into another function, but
if you want the loop too, that's possible as well.

The large loop. Whether that should also include the
gpm_timer_setup() call as well is up to you.

(there's one remaining if (func(foo) == val), but that's because the
call would then clobber ret. Do you want me to introduce another
temp variable?) ``

That would probably be good - maybe an epoll-specific one, epoll_ret,
or so?

This should look a little better then :)

Moved the loop to gpm_timeout_loop(...), and added epoll_ret.

rebased

please call it gpm_send_recv_loop()

rebased

I think you missed one place to use epoll_ret - ret = epoll_wait(gpmctx->epollfd, events, 2, -1);

rebased

@rharwood: Originally I thought that would have the same problem we're trying to avoid -- now clobbering epoll_ret with the latter epoll_ctl call return value. But I guess not. :) Updated.

Commit 4097dafa fixes this pull-request

Pull-Request has been merged by ascheel@redhat.com

Commit d46603c9 fixes this pull-request

Pull-Request has been merged by ascheel@redhat.com

Commit 4097dafa fixes this pull-request

Pull-Request has been merged by ascheel@redhat.com

Metadata