net: ipv4 chosen first when both ipv4 and ipv6 are available

What version of Go are you using (go version)?

$ go version
go version go1.19 darwin/amd64

Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/acruz/Library/Caches/go-build"
GOENV="/Users/acruz/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/acruz/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/acruz/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.19/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.19/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.19"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/50/p3qbm6c112v0sdym26_t_bq80000gn/T/go-build466847973=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?
Connect to a host that resolves both to ipv4 and ipv6 addresses.
What did you expect to see?
According to https://github.com/golang/go/blob/master/src/net/dial.go#L71, with the default FallbackDelay of 300ms, ipv6 should be tried first and only after the configured delay ipv4 should be attempted.
What did you see instead?
ipv4 was chosen first.
The partition function uses the label of the first result, which is the DNS result that resolved first (A vs AAAA). If the A response was received first, then the primary address(es) will be ipv4, which contradicts the purpose of the Happy Eyeballs RFC.

CC @neild

If the A response was received first, then the primary address(es) will be ipv4, which contradicts the purpose of the Happy Eyeballs RFC.

You are correct that the behaviour is different to the first Happy Eyeballs RFC (RFC 6555), but it does match Happy Eyeballs v2 (RFC 8305) which removes the preference for IPv6.
The important thing is to try both address families in parallel. If the winner happens to be IPv4, then so be it. Maybe the Dialer.FallbackDelay documentation should be considered the bug.

Ah, interesting. Didn't realize there were two versions. In that case, it seems compliant.
It is unfortunate however that we can't seem to influence the sorting order of these addresses/families. DNS resolution time does not always correlate to the best addresses to try first.
Should I just update the documentation?

You are correct that the behaviour is different to the first Happy Eyeballs RFC (RFC 6555), but it does match Happy Eyeballs v2 (RFC 8305) which removes the preference for IPv6.
The important thing is to try both address families in parallel. If the winner happens to be IPv4, then so be it. Maybe the Dialer.FallbackDelay documentation should be considered the bug.

This is incorrect. RFC 8305 section 3 says:
   The algorithm proceeds as follows: if a positive AAAA response (a
   response with at least one valid AAAA record) is received first, the
   first IPv6 connection attempt is immediately started.  If a positive
   A response is received first due to reordering, the client SHOULD
   wait a short time for the AAAA response to ensure that preference is
   given to IPv6 (it is common for the AAAA response to follow the A
   response by a few milliseconds).  This delay will be referred to as
   the "Resolution Delay".  The recommended value for the Resolution
   Delay is 50 milliseconds.  If a positive AAAA response is received
   within the Resolution Delay period, the client immediately starts the
   IPv6 connection attempt.

Go currently implements Happy Eyeballs v1, not v2.

which is the DNS result that resolved first (A vs AAAA)

This is probably only true for the Go resolver. Not sure how it's like on macOS, but on Linux and macOS, without explicitly disabling CGO, Happy Eyeballs works as expected, because the system's name resolution API takes care of sorting the addresses for you. Both getaddrinfo on Linux and GetAddrInfoW on Windows place IPv6 addresses before IPv4 by default when the system has public IPv6 addresses.
To make Happy Eyeballs work with the Go resolver, the resolver would need a new API to stream results back to the caller.

It seems that in some environments getaddrinfo doesn't always produce those results:
Debian Linux host:
$ python3 -c "import socket; print(socket.getaddrinfo('google.com', 0))"
[(<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('2607:f8b0:4005:810::200e', 0, 0, 0)), (<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('2607:f8b0:4005:810::200e', 0, 0, 0)), (<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_RAW: 3>, 0, '', ('2607:f8b0:4005:810::200e', 0, 0, 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('<IP_ADDRESS>', 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('<IP_ADDRESS>', 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_RAW: 3>, 0, '', ('<IP_ADDRESS>', 0))]

debian image running in docker container in the linux host above:
root@cdbbe91e6d71:/# python3 -c "import socket; print(socket.getaddrinfo('google.com', 0))"
[(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('<IP_ADDRESS>', 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('<IP_ADDRESS>', 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_RAW: 3>, 0, '', ('<IP_ADDRESS>', 0)), (<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('2607:f8b0:4005:810::200e', 0, 0, 0)), (<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('2607:f8b0:4005:810::200e', 0, 0, 0)), (<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_RAW: 3>, 0, '', ('2607:f8b0:4005:810::200e', 0, 0, 0))]

MacOS host:
❯ python3 -c "import socket; print(socket.getaddrinfo('google.com', 0))"
[(<AddressFamily.AF_INET6: 30>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('2a00:1450:4003:801::200e', 0, 0, 0)), (<AddressFamily.AF_INET6: 30>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('2a00:1450:4003:801::200e', 0, 0, 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('<IP_ADDRESS>', 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('<IP_ADDRESS>', 0))]

Debian linux container running on Docker in MacOS host:
root@c7f8e648bbd7:/# python3 -c "import socket; print(socket.getaddrinfo('google.com', 0))"
[(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('<IP_ADDRESS>', 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('<IP_ADDRESS>', 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_RAW: 3>, 0, '', ('<IP_ADDRESS>', 0)), (<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('2a00:1450:4003:801::200e', 0, 0, 0)), (<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('2a00:1450:4003:801::200e', 0, 0, 0)), (<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_RAW: 3>, 0, '', ('2a00:1450:4003:801::200e', 0, 0, 0))]

At least in container environments ipv4 addresses seem to be returned first?

Did you run your container with --net host? By default getaddrinfo only returns IPv6 addresses first if you have public IPv6 addresses. The behavior can be configured in /etc/gai.conf.

It seems you are indeed correct, using the host network ipv6 addresses are returned first. Do you know, by any chance, how to configure gai.conf so as to make ipv6 results appear first even when it seems ipv6 is not configured?
The configured precedences already prioritize ipv6...
Thanks.

Closing since Go seems to be working as expected after all.

Closing since Go seems to be working as expected after all.

For me, that is not working as expection, still handle ipv4 first.
go version go1.20.4 linux/amd64


Makara doesn't switch to slave when using AR.connection directly

Here you can see that reads are from slave when using model methods... but not connection itself:
production >> SlaveUtils.read_from_slave { User.first }
  [slave/1] User Load (0.6ms)  SELECT  `users`.* FROM `users` ORDER BY `users`.`id` ASC LIMIT 1
production >> SlaveUtils.read_from_slave { User.connection.select_all('show processlist') }
  [master/1] (1.4ms)  show processlist
production >>
``

This is unrelated to using model methods vs connection methods. You're comparing two different SQL statements. Makara decides which queries to send where based on whether they need the primary db or can use a replica. The show query falls back to the primary connection since it doesn't match any of the regexps.
To verify: If you do a SELECT on the connection first, it'll pick a replica connection and a subsequent SHOW PROCESSLIST should stick to the same connection.

Thanks for clarification. I am not sure I got it at 100%.
Should I do it like this:
production >> SlaveUtils.read_from_slave { User.connection.select_all('SELECT  `users`.* FROM `users` ORDER BY `users`.`id` ASC LIMIT 1'); User.connection.select_all('show processlist'); nil }
  [slave/1] (0.7ms)  SELECT  `users`.* FROM `users` ORDER BY `users`.`id` ASC LIMIT 1
  [master/1] (1.3ms)  show processlist
=> nil


[move-to-yul] Fixes to memory primitives & passing basic reference and struct tests

This turns the code examples in tests/Structs.move and tests/Locals.move into tests, and fixes bugs on the way in the handling of references and structs. At this point, we have basic things like packing and unpacking structs, and working with references to locals and to fields working.
There where two major bugs in the memory primitives: (a) calling shl and shr with wrong parameter order (b) wrongly assuming low endian architecture for packing bytes in words. Unfortunately, the big endian architecture makes things a bit more tricky. So most of the primitives around LoadUNN and StoreUNN are rewritten. Notice this does not yet test storage, only memory.
Motivation
EVM
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
New tests

/land


vendor: github.com/containerd/nri v0.5.0

This version no longer has a dependency on containerd, cutting down the number of circular dependencies.
full diff: https://github.com/containerd/nri/compare/v0.4.0...v0.5.0

[x] follow-up to https://github.com/containerd/containerd/pull/9088
[x] depends on https://github.com/containerd/nri/pull/51

@samuelkarp @mikebrow everything looks happy here as well; if we do a new tag of containerd/nri, I can update this PR, and move it out of draft 👍

Looks good, tagged https://github.com/containerd/nri/releases/tag/v0.5.0

Thanks! Updated to use the tag, and moved it out of draft


[EFR32] Add Board Support for efr32 boards

Problem
Some boards were not supported for Matter
Change overview
Add board support  for BRD2703A and BRD4162A
Testing
Manual tests with BRD2703A and BRD4162A boards

@mkardous-silabs - could you please add to the description the reason why this is a required/acceptable 1.0 change?
Master changes is supposed to now accept:

spec compliance issues
critical security fixes
platform fixes (if a platform fix impacts another platform or the core sdk, it shall be more carefully scrutinized)
core SDK fixes that have significant value (memory leak, crash, latency/performance, interop, ...)
fixes meant to improve testing and/or testability
common cluster logic that have significant value

This PR seems to be somewhere in 'platform specific' (but it is not a platform fix directly ...) and interop (new boards added ... so chip working on additional boards ... not sure if that is interop)

@mkardous-silabs - could you please add to the description the reason why this is a required/acceptable 1.0 change?
Master changes is supposed to now accept:

spec compliance issues
critical security fixes
platform fixes (if a platform fix impacts another platform or the core sdk, it shall be more carefully scrutinized)
core SDK fixes that have significant value (memory leak, crash, latency/performance, interop, ...)
fixes meant to improve testing and/or testability
common cluster logic that have significant value

This PR seems to be somewhere in 'platform specific' (but it is not a platform fix directly ...) and interop (new boards added ... so chip working on additional boards ... not sure if that is interop)

@andy31415
The PR is 100% platform specific to efr32. The only thing it does is add support for 2 extra boards. We would like this PR to be merged to enable more teams to be able to test matter since not all sites have access to some boards.

@andy31415 Updated the Comments as requested.


fs module not found

Hey, I have been working on this project it uses

next.js
node version 18.16.1

I have been getting this issue.

Only on just importing.
import { QRCodeCanvas } from "@loskir/styled-qr-code-node";

for those who didn't find the solution, try using styled-qr-code module on front-end

for those who didn't find the solution, try using styled-qr-code module on front-end

Wasn't the fork made specifically for node? If you want to use the module on front-end, use the actual library, and not the fork


visualize protein 3d structure in python scripts

Hi. I found this tool can beautifully visualize the protein structure in jupyter notebook. I wonder if this can be implemented in python scripts.

Hi @pengzhangzhi, would you be able to share a bit more context about what you're trying to achieve?
For instance, the following script works:
# example_plot.py

import graphein.protein as gp

if __name__ == "__main__":
    g = gp.construct_graph(pdb_code="3eiy")
    fig = gp.plotly_protein_structure_graph(g)
    fig.show()

Hi @a-r-j ,thank you for the information. can the code save the figure?  Since this tool can visualize beautiful protein structures, I want to implement this idea using your tool.

Yep!
You can save them as HTML (maintains interactivity) and in static format.

Thank you for your helpful feedback! You are very nice!

Happy to help! :hugs:


Cannot read property '$$' of undefined

Problem
The <Canvas> element throws hundreds of Uncaught TypeError errors while hovering over it, the canvas works as intended, however it causes the browser to hang a lot when the debug console is open.
Full Error
node_modules/svelte/internal/index.mjs:691 Uncaught TypeError: Cannot read property '$$' of undefined
    at bubble (node_modules/svelte/internal/index.mjs:691)
    at HTMLCanvasElement.eval (node_modules/svelte-canvas/src/forwardEvents.js:24)

Possible Cause
I don't have enough experience with canvas and event forwarding to understand what might be going on, but the problem seems to be coming from this line
https://github.com/dnass/svelte-canvas/blob/cf1dd0efc18c3c2bcfd24330091ee01ada0b06d2/src/forwardEvents.js#L24

Thanks, can you share a code snippet that reproduces this issue?

I just copied all the related code to a separate project to try and reproduce the issue, however, I'm unable to, though I find out it seems to be related to component in this line being undefined in svelte/internal. So it might be an issue related to something in svelte itself.


Remove invalid import

Is the fix already in master?  If not, link the bug tracking that work. [PENDING]
What testing was done? [Manually uploaded the task and ran build with hosted agent]
Does this fix change the AT/DT contract? NO
Does this fix include any database servicing changes? NO
Were tests added to cover this to make sure it doesn't regress?  If not, link a bug or user story tracking that work. Tests were added

LGTM


is .throttle() implemented?

btw this tool is amazing :)

perhaps i'm using it incorrectly...

Should be! https://github.com/lapwinglabs/x-ray/blob/master/index.js#L35
var x = Xray()
  .throttle(5, '1s')

yup! thanks!


Stuttering while building new cells

I created a simple setup with a moving player and I'm experiencing some stutter.
The joystick is present in the example just to help seeing the stutter with debug set to off, but it still stutters if you remove it and move the player in some other way. Debug mode off makes the stutter a lot weaker, but still present.
Is this an expected behavior in the current state of the project?
https://github.com/ASGAlex/flame_spatial_grid/assets/4193707/81d2a830-feb0-45f8-aceb-574f5df2aa9a
import 'dart:async';

import 'package:flame/components.dart';
import 'package:flame/extensions.dart';
import 'package:flame/game.dart';
import 'package:flame/palette.dart';
import 'package:flame_spatial_grid/flame_spatial_grid.dart';

const _debugEnabled = true;

class MinimalGame extends FlameGame with HasSpatialGridFramework {
  MinimalGame();

  final world = MyWorld();
  late final CameraComponent cameraComponent;
  late final JoystickComponent joystick;

  @override
  FutureOr<void> onLoad() async {
    _createJoystick();

    final player = Player(position: Vector2.zero());

    cameraComponent = CameraComponent(
      world: world,
      hudComponents: [joystick, FpsTextComponent()],
    );
    cameraComponent.viewfinder.zoom = 1;
    cameraComponent.priority = 999;
    cameraComponent.follow(player, maxSpeed: 200, snap: true);

    await initializeSpatialGrid(
      cellSize: 50,
      rootComponent: world,
      trackedComponent: SpatialGridDebugCameraWrapper(cameraComponent),
      trackWindowSize: false,
      debug: _debugEnabled,
    );

    add(world);
    world.add(player);

    return super.onLoad();
  }

  void _createJoystick() {
    joystick = JoystickComponent(
      knob: CircleComponent(
        radius: 25,
        paint: BasicPalette.lightBlue.paint(),
      ),
      background: CircleComponent(
        radius: 100,
        paint: BasicPalette.blue.paint(),
      ),
      position: Vector2.all(100),
    );
  }
}

class SpatialGridDebugCameraWrapper extends SpatialGridCameraWrapper {
  SpatialGridDebugCameraWrapper(super.cameraComponent);

  @override
  void onAfterZoom() {
    try {
      if (!game.isSpatialGridDebugEnabled) {
        game.onAfterZoom();
      }
      // ignore: avoid_catches_without_on_clauses, empty_catches
    } catch (e) {}
  }
}

class Player extends PositionComponent
    with HasGridSupport, HasPaint, HasGameRef<MinimalGame> {
  Player({super.position})
      : super(
          size: Vector2(25, 25),
          anchor: Anchor.center,
        ) {
    paint.color = BasicPalette.yellow.color;
    debugMode = _debugEnabled;
  }

  late final _rect = Rect.fromLTWH(0, 0, size.x, size.y);

  @override
  void render(Canvas canvas) {
    canvas.drawRect(_rect, paint);
  }

  @override
  void update(double dt) {
    super.update(dt);
    if (!game.joystick.delta.isZero()) {
      position.add(
        game.joystick.relativeDelta * 100 * dt,
      );
    }
  }
}

class MyWorld extends World {}

@daniel-mf did you found a solution for your case?
For your example it is only necessary to change processCellsLimitToPauseEngine  to larger value (default is 5) to prevent engine pausing while building new cells. But in games with complex logic it may become a reason of bugs. In this cause it become better to pause whole game during loading.


Text sentimental Analysis script

Aim

create a script for text sentimental analysis

Details

in this a person could enter a text / paragraph as an input and in return he/she will get a idea about the impact of the text is it a positive impact text or negative impact

This issue is already in progress: https://github.com/avinashkranjan/Amazing-Python-Scripts/issues/211


Set one default transport for all pulled packages

Is there a way in AG (user exit?) to set one default transport for all pulls system-wide ?
My use-case: a standalone dev system, no transportation needed. All developers create their transports which, with time, start to conflict between each other. So idea is to force (as much as possible) to use one single transport for all users, to quickly release it when conflicts are unbearable.
If there is no such a feature, maybe create one ? as a setting or a user exit ?
P.S. maybe I'm inventing a bicycle ... Is there a way to completely disable workbench transports in a given system ?
P.P.S. option is to use $ package names.

It should be $-packages and SAP should fix the issues you mentioned...
An exit makes sense for another reason: The transport popup is disrupting the flow and it would be nice to have the transport determined by code instead.

May be the menu Standard Request under Utilities might be helpful here.
You can set a Transport as Standard Request so that any lockable/not lockable objects are recorded under that Transport only.

$ package names unit tests: the abapgit unit test feature can be used?

Cool ! 🎉 Thank again @christianguenter2


npm package ?

I'd love to use this in my node app. :)
React in particular

No promises, but I may have some time to work on this over the holidays.

Better late then never: https://www.npmjs.com/package/continuous-carousel


Bad Channel Detection in CTF MEG Data Analysis

Dear FLUX,
I am currently working on analyzing my CTF MEG dataset and have encountered a challenge regarding bad channel detection. Specifically, I have noticed that when using Max Filter for analysis. However, it appears that my CTF data does not include the necessary “cross_talk file” and “calibration_file.” I would greatly appreciate any guidance or advice on how to address this issue and successfully perform bad channel detection and Max Filter(SSS) with my CTF MEG data. The code snippet I’m using is as follows:
auto_noisy_chs, auto_flat_chs, auto_scores = mne.preprocessing.find_bad_channels_maxwell(
    data1_check,
    cross_talk=crosstalk_file,
    calibration=calibration_file,
    return_scores=True,
    verbose=True)
Best regards,

Cole

Hi Cole,
I am also working on analyzing CTF MEG data recently. Maybe I can try to answer your questions.
It appears that the application of Max Filter (SSS) for noise reduction is not compatible with CTF MEG data. CTF MEG data employs a third-order gradient compensation algorithm, which relies on a reference array of gradiometers and magnetometers for noise reduction. And this had also been added in #21
Moreover, some CTF system itself inherently can perform third-order gradient compensation during data collection. Therefore, you can try to seek the assistance from a data collection engineer or a data collection experimenter for optimizing this process.
In terms of detecting bad and flat channels, I found it is ok to use the function 'mne.preprocessing.find_bad_channels_maxwell', here's an example of its usage, just set the parameters “cross_talk” and “calibration” as ‘None’:
auto_noisy_chs, auto_flat_chs, auto_scores = mne.preprocessing.find_bad_channels_maxwell(
    raw=raw_data_check,
    return_scores=True,
    origin=(0,0,0.04),
    cross_talk=None,
    calibration=None,
    verbose=True)

Haiyan Kong

My goodness, I just saw this. I also figured out how to apply Maxwell to CTF data in a similar way to yours. Thank you very much, and wish you all the best!


UI issue in chrome 50.0.2661.75 m, in which only showing header, rest page is blank.here is my theame link http://flatfull.com/themes/materil/angular/#/app/dashboard

Note: for support questions, please use one of these channels: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports.
Do you want to request a feature or report a bug?
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).
What is the expected behavior?
What is the motivation / use case for changing the behavior?
Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
Other information (e.g. stacktraces, related issues, suggestions how to fix)

It's difficult to say what your issue is. It reads like you have a problem with angular material which has a separate repo: https://github.com/angular/material. You should also provide more info for your problem, such as version of material & angular used.