Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid garbage references when DNS resolution rejects on legacy PHP <= 5.6 #133

Merged
merged 1 commit into from Jul 10, 2019

Conversation

Projects
None yet
3 participants
@clue
Copy link
Member

commented Jul 10, 2019

These garbage references only show up when a DNS lookup rejects with an
Exception on legacy PHP <= 5.6. These issues have been fixed upstream in
the Promise component for current PHP versions with
https://github.com/reactphp/promise/releases/tag/v2.6.0 but this PR
explicitly unsets known garbage references to avoid unexpected memory
growth on legacy PHP versions.

The downstream Socket component implicitly depends on this because its
test suite currently fails. This changeset can be considered a new
feature in this component which fixes a bug in the test suite of a
downstream component.

Accordingly to the roadmap (#128) we planned to stop the v0.4.x series, but I consider this to be a notable issue that warrants a v0.4.19 release. Once accepted, I will manually merge this into the current master branch targeting the upcoming v1.0.0 milestone.

Builds on top of #125 and #129
Refs #118

@clue clue added the new feature label Jul 10, 2019

@clue clue added this to the v0.4.19 milestone Jul 10, 2019

@clue clue requested review from jsor and WyriHaximus Jul 10, 2019

@clue clue changed the title Avoid garbage references when resolving rejects on legacy PHP <= 5.6 Avoid garbage references when DNS resolution rejects on legacy PHP <= 5.6 Jul 10, 2019

@clue

This comment has been minimized.

Copy link
Member Author

commented Jul 10, 2019

For the reference: I've verified this actually fixes the build error for the downstream socket component (https://travis-ci.org/reactphp/socket/builds/556729141) by applying this version manually:

# composer.json.patch
{
    "require": {
        "react/dns": "dev-legacy-garbage as 0.4.19"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/clue/dns"
        }
    ],
    "config": {
        "platform": {
            "php": "5.6.30"
        }
    }
}
$ cd ~/workspace/reactphp-socket
$ composer update
$ docker run --rm -it -v `pwd`:/data --entrypoint=vendor/bin/phpunit --workdir=/data php:5.6

In other words: Once this PR is in and tagged as v0.4.19, the upstream component will build just fine again without any modification 👍

Avoid garbage references when resolving rejects on legacy PHP <= 5.6
These garbage references only show up when a DNS lookup rejects with an
Exception on legacy PHP <= 5.6. These issues have been fixed upstream in
the Promise component for current PHP versions with
https://github.com/reactphp/promise/releases/tag/v2.6.0 but this PR
explicitly unsets known garbage references to avoid unexpected memory
growth on legacy PHP versions.

The downstream Socket component implicitly depends on this because its
test suite currently fails. This changeset can be considered a new
feature in this component which fixes a bug in the test suite of a
downstream component.

@clue clue force-pushed the clue-labs:legacy-garbage branch from 8e8d861 to e6cb8d8 Jul 10, 2019

@jsor

jsor approved these changes Jul 10, 2019

@jsor jsor merged commit ba897d4 into reactphp:0.4 Jul 10, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@clue clue deleted the clue-labs:legacy-garbage branch Jul 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.