Skip to content

feat(bigtable): populate reasons on why direct access was not accessible#2905

Open
sushanb wants to merge 1 commit intomainfrom
populate_reason
Open

feat(bigtable): populate reasons on why direct access was not accessible#2905
sushanb wants to merge 1 commit intomainfrom
populate_reason

Conversation

@sushanb
Copy link
Copy Markdown
Contributor

@sushanb sushanb commented Apr 24, 2026

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Rollback plan is reviewed and LGTMed
  • All new data plane features have a completed end to end testing plan

Fixes #<issue_number_goes_here> ☕️

If you write sample code, please follow the samples format.

@sushanb sushanb requested a review from nimf April 24, 2026 20:47
@sushanb sushanb requested review from a team as code owners April 24, 2026 20:47
@product-auto-label product-auto-label Bot added size: l Pull request size is large. api: bigtable Issues related to the googleapis/java-bigtable API. labels Apr 24, 2026
Copy link
Copy Markdown
Contributor

@nimf nimf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments.

originalError);
return;
}
// Default fallback if investigation could not determine a specific issue recordAndLog(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Default fallback if investigation could not determine a specific issue recordAndLog(
// Default fallback if investigation could not determine a specific issue

if ("Linux".equals(osName)) {
String productName = getSystemProductName();
return productName.contains(GCE_PRODUCTION_NAME_PRIOR_2016)
|| productName.contains(GCE_PRODUCTION_NAME_AFTER_2016);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, if it doesn't contain "Google" why do we need to check if it contains "Google Compute Engine"?
I.e., do we want "contains" or match the whole string?

Comment on lines +41 to +87
/**
* Verifies that the standard IPv4 localhost address (127.0.0.1) is bound to a loopback interface.
*/
static boolean hasLocalIpv4Loopback() throws Exception {
return checkLocalLoopbackAddress("127.0.0.1");
}

/** Verifies that the standard IPv6 localhost address (::1) is bound to a loopback interface. */
static boolean hasLocalIpv6Loopback() throws Exception {
return checkLocalLoopbackAddress("::1");
}

static boolean isIpPlumbed(InetAddress expectedIp) throws Exception {
if (expectedIp == null) {
return false;
}
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
NetworkInterface iface = interfaces.nextElement();
if (!iface.isLoopback() && iface.isUp()) {
Enumeration<InetAddress> addrs = iface.getInetAddresses();
while (addrs.hasMoreElements()) {
if (addrs.nextElement().equals(expectedIp)) {
return true;
}
}
}
}
return false;
}

private static boolean checkLocalLoopbackAddress(String expectedIp) throws Exception {
InetAddress expected = InetAddress.getByName(expectedIp);
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
NetworkInterface iface = interfaces.nextElement();
if (iface.isLoopback() && iface.isUp()) {
Enumeration<InetAddress> addrs = iface.getInetAddresses();
while (addrs.hasMoreElements()) {
if (addrs.nextElement().equals(expected)) {
return true;
}
}
}
}
return false;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These methods are not used. Only isUp is used. Do we need them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the googleapis/java-bigtable API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants