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

[release/5.0-rc2] Restore exception compatibility in TcpListener.EndAccept*** #41938

Merged
merged 3 commits into from
Sep 8, 2020

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 7, 2020

Backport of #41745 to release/5.0-rc2

/cc @antonfirsov

Customer Impact

Removes an unwanted breaking change (#41585), improving migration experience for for users of TcpListener.
This was discovered during app-compat testing.

Testing

A (previously missing) test has been introduced for the case.

Risk

Low or none. The change is limited to the APM methods of TcpListener.

@antonfirsov
Copy link
Member

CI failures seem to be Helix issues (failing to proceed after successful test run). None of them seemt obe related to System.Net.Sockets.

@ghost
Copy link

ghost commented Sep 7, 2020

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@antonfirsov antonfirsov added tenet-compatibility Incompatibility with previous versions or .NET Framework Servicing-consider Issue for next servicing release review labels Sep 7, 2020
IAsyncResult iar = listener.BeginAcceptSocket(callback: null, state: null);

// Give some time for the underlying OS operation to start:
Thread.Sleep(50);
Copy link
Member

Choose a reason for hiding this comment

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

We often see tests fail because of slow test machines, I wonder whether this will reliably be long enough.

Copy link
Member

Choose a reason for hiding this comment

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

In this test the next call should throw ObjectDisposedException independently from timing, so slow machines should not bring an issue hopefully.

@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Sep 8, 2020
@danmoseley
Copy link
Member

@antonfirsov OK to merge when green.

@danmoseley
Copy link
Member

@dotnet/dnceng it seems Helix had some issues while running some of these legs. Eg.,

Worker 0: got error: Traceback (most recent call last):
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 426, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 421, in _make_request
    httplib_response = conn.getresponse()
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 1346, in getresponse
    response.begin()
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 307, in begin
    version, status, reason = self._read_status()
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 268, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/socket.py", line 586, in readinto
    return self._sock.recv_into(b)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 1012, in recv_into
    return self.read(nbytes, buffer)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 874, in read
    return self._sslobj.read(len, buffer)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 631, in read
    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 677, in urlopen
    chunked=chunked,
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 428, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 336, in _raise_timeout
    self, url, "Read timed out. (read timeout=%s)" % timeout_value
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='dev.azure.com', port=443): Read timed out. (read timeout=100)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.azdo-env/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 767, in urlopen
    **response_kw
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 767, in urlopen
    **response_kw
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 767, in urlopen
    **response_kw
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 727, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/util/retry.py", line 439, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='dev.azure.com', port=443): Max retries exceeded with url: /dnceng/public/_apis/test/Runs/25481974/Results/108910/Attachments (Caused by ReadTimeoutError("HTTPSConnectionPool(host='dev.azure.com', port=443): Read timed out. (read timeout=100)",))

https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-41938-merge-3162ef2a65a74a9bbe/System.Console.Manual.Tests/console.8d431e4d.log?sv=2019-02-02&se=2020-09-27T13%3A29%3A25Z&sr=c&sp=rl&sig=J9YhitvlHC%2FeeqT%2FUO0wn9EiCQrZq0R2oBOxMjzAVds%3D

@danmoseley
Copy link
Member

I clicked rerun failed jobs.

@MattGal
Copy link
Member

MattGal commented Sep 8, 2020

@dotnet/dnceng it seems Helix had some issues while running some of these legs. Eg.,

Worker 0: got error: Traceback (most recent call last):
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 426, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 421, in _make_request
    httplib_response = conn.getresponse()
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 1346, in getresponse
    response.begin()
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 307, in begin
    version, status, reason = self._read_status()
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/http/client.py", line 268, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/socket.py", line 586, in readinto
    return self._sock.recv_into(b)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 1012, in recv_into
    return self.read(nbytes, buffer)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 874, in read
    return self._sslobj.read(len, buffer)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 631, in read
    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 677, in urlopen
    chunked=chunked,
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 428, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 336, in _raise_timeout
    self, url, "Read timed out. (read timeout=%s)" % timeout_value
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='dev.azure.com', port=443): Read timed out. (read timeout=100)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.azdo-env/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 767, in urlopen
    **response_kw
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 767, in urlopen
    **response_kw
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 767, in urlopen
    **response_kw
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 727, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/root/.azdo-env/lib/python3.6/site-packages/urllib3/util/retry.py", line 439, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='dev.azure.com', port=443): Max retries exceeded with url: /dnceng/public/_apis/test/Runs/25481974/Results/108910/Attachments (Caused by ReadTimeoutError("HTTPSConnectionPool(host='dev.azure.com', port=443): Read timed out. (read timeout=100)",))

https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-41938-merge-3162ef2a65a74a9bbe/System.Console.Manual.Tests/console.8d431e4d.log?sv=2019-02-02&se=2020-09-27T13%3A29%3A25Z&sr=c&sp=rl&sig=J9YhitvlHC%2FeeqT%2FUO0wn9EiCQrZq0R2oBOxMjzAVds%3D

Sounds like fairly typical network flakiness but taking a peek

@antonfirsov antonfirsov merged commit 944d33e into release/5.0-rc2 Sep 8, 2020
@jkotas jkotas deleted the backport/pr-41745-to-release/5.0-rc2 branch September 8, 2020 20:51
@karelz karelz added this to the 5.0.0 milestone Sep 10, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Sockets Servicing-approved Approved for servicing release tenet-compatibility Incompatibility with previous versions or .NET Framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants