Page MenuHomeFreeBSD

libfetch: Further improve connection polling
AcceptedPublic

Authored by des on Tue, Jul 28, 9:16 AM.
Tags
None
Referenced Files
F164083685: D58512.diff
Tue, Jul 28, 2:08 PM
F164081488: D58512.diff
Tue, Jul 28, 1:40 PM
Unknown Object (File)
Tue, Jul 28, 9:59 AM
Subscribers

Details

Reviewers
markj
Summary
  • Reorganize the connection loop to make it a little more readable
  • Start the timeout clock earlier
  • Correctly calculate the poll timeout before calling poll()
  • Don't leak the socket on failure

Fixes: 848f360c8f9a ("libfetch: Apply timeout to connection attempts")
Fixes: b02e02958dad ("libfetch: Fix handling of connection failures")
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 75233
Build 72116: arc lint + arc unit

Event Timeline

des requested review of this revision.Tue, Jul 28, 9:16 AM
lib/libfetch/common.c
652

Probably we need to preserve errno around this too?

686–695

Do you need to test err == 0 first?

731

The socket is cleaned up here, how is it leaked?

des marked 2 inline comments as done.Tue, Jul 28, 2:00 PM
des added inline comments.
lib/libfetch/common.c
652

No, fetch_verbose() is a wrapper around fetch_info() which saves and restores errno.

686–695

yes

des marked 2 inline comments as done.

rf

des marked an inline comment as done.Tue, Jul 28, 2:04 PM
des added inline comments.
lib/libfetch/common.c
731

If there were multiple addresses we'd leak all but the last socket.

des marked an inline comment as done.Tue, Jul 28, 2:07 PM
This revision is now accepted and ready to land.Tue, Jul 28, 2:12 PM