Open Bug 1525659 Opened 8 months ago Updated 13 days ago

Avoid hardcoding geckodriver’s HTTPD to IPv4

Categories

(Testing :: geckodriver, enhancement, P1)

Version 3
enhancement

Tracking

(Not tracked)

People

(Reporter: ato, Unassigned)

References

(Blocks 1 open bug, )

Details

To make it possible to connect to geckodriver on either IP transport
layer (IPv4 or IPv6), we should stop hardcoding geckodriver’s HTTPD
to listen on 127.0.0.1.

If we assign localhost to it, we can rely on system to tell us which
IP layer to listen on. Most system allow both, so this would make
it possible to connect on both ::1 and 127.0.0.1.

Originally reported in https://github.com/mozilla/geckodriver/issues/1496.

Assignee: nobody → ato
Status: NEW → ASSIGNED
Priority: -- → P1

So we originally forced that in geckodriver 0.21.0 due to:

On certain system configurations, where localhost resolves to
an IPv6 address, geckodriver would attempt to connect to Firefox
on the wrong IP stack, causing the connection attempt to time out
after 60 seconds. We now ensure that geckodriver uses IPv4
consistently to both connect to Firefox and for allocating a free
port.

I assume that this problem is solved?

Flags: needinfo?(ato)

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #1)

So we originally forced that in geckodriver 0.21.0 due to:

On certain system configurations, where localhost resolves to
an IPv6 address, geckodriver would attempt to connect to Firefox
on the wrong IP stack, causing the connection attempt to time out
after 60 seconds. We now ensure that geckodriver uses IPv4
consistently to both connect to Firefox and for allocating a free
port.

I assume that this problem is solved?

You are confusing the Marionette socket, limited by nsIServerSocket,
with the client-facing HTTPD socket.

Flags: needinfo?(ato)

Well, please read bug 1462040 first, if that change was faulty or not. I don't want to introduce the old faulty behavior again.

We have to make sure that geckodriver always used IPv4 for the Marionette connection. So we might need two independent host definitions here.

#[markdown(off)]

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+1] from comment #3)

> Well, please read bug 1462040 first, if that change was faulty or
> not. I don't want to introduce the old faulty behavior again.
>
> We have to make sure that geckodriver always used IPv4 for the
> Marionette connection. So we might need two independent host
> definitions here.

Again, this is not related to the Marionette connection.

I’ve run in to a number of snags fixing this bug:

  1. We rely on IpAddr which takes a variant of either an
    IPv4 or IPv6 address. It appears hyper only accepts one of the
    two. More investigation needed.

  2. Flag errors are emitted using the error!() macro from the
    log crate, and these are not visible unless the log level is
    cranked up, which we cannot guarantee at the point of parsing
    flags.

  3. Error descriptions aren’t included in the error we print to
    the user. We reduce it to just a generic custom message, and
    throw away the error description.

As 2 and 3 must be fixed together, I’ve filed
https://bugzilla.mozilla.org/show_bug.cgi?id=1526938 about this and
made this bug depend on fixing that first.

Depends on: 1526938
Assignee: ato → nobody
Status: ASSIGNED → NEW
Blocks: 1573798
You need to log in before you can comment on or make changes to this bug.