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

[Bug] The handling of Socket EOF under Wisp is problematic #124

Closed
yuleil opened this issue Aug 25, 2020 · 1 comment
Closed

[Bug] The handling of Socket EOF under Wisp is problematic #124

yuleil opened this issue Aug 25, 2020 · 1 comment
Assignees

Comments

@yuleil
Copy link
Collaborator

yuleil commented Aug 25, 2020

Description
Continue reading socket after reading EOF:

  • enable Wisp: SocketException("closed")
  • disable Wisp: got eof(-1)

Steps to Reproduce
Steps to reproduce the behavior:

  1. Save below snippet '...'
  2. Compile it with javac '....'
  3. Execute with VM options '....'
  4. See error

Expected behavior
the behavior of reading a closed socket is consistent after switching wisp

JDK version
Dragonwell 8.4.4

Execution environment

  • OS and version:
  • CPU model:
  • Number of CPU cores:
  • Size of physical memory:
  • Inside Linux container?
    • Linux container name (docker, pouch, etc):
    • Linux container version:
@yuleil yuleil self-assigned this Aug 25, 2020
@yuleil
Copy link
Collaborator Author

yuleil commented Sep 16, 2020

import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class A {

    public static void main(String[] args) throws Exception {
        ServerSocket serverSocket = new ServerSocket(0);
        Socket fd = new Socket("localhost", serverSocket.getLocalPort());
        /* 1. */ serverSocket.accept().close();
        InputStream is = fd.getInputStream();
        /* 2. */ is.read();
        /* 3. */ fd.close();
        /* 4. */ is.read();
    }
}

This is a piece of reproducing code. Note the first is.read() is required.

yuleil added a commit to dragonwell-project/dragonwell8_jdk that referenced this issue Sep 16, 2020
Summary:
Refactoring WispSocket's InputStream and OutputStream
creating code for readability.

Test Plan: all wisp tests

Reviewed-by: joeyleeeeeee97 shiyuexw

Issue: dragonwell-project/dragonwell8#124
yuleil added a commit to dragonwell-project/dragonwell8_jdk that referenced this issue Sep 17, 2020
Summary:
Make the behavior of reading a closed socket to be consistent
after switching wisp.

Test Plan: Wisp2SocketCloseExceptionTest

Reviewed-by: joeyleeeeeee97 shiyuexw

Issue: dragonwell-project/dragonwell8#124
@yuleil yuleil closed this as completed Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant