WAI
Status Update
Comments
mz...@google.com <mz...@google.com> #2
Thank you for the report, and sorry for any inconvenience. While reproducing the issue, one workaround I found is: -keeppackagenames com.example.customview.extra** (i.e., double asterisks, instead of single).
https://www.guardsquare.com/en/products/proguard/manual/usage#filters
R8 currently regards <package_filter> in that directive as <class_filter>. That's why single asterisk---a class name not containing the package separator---doesn't work for now, whereas double asterisks---matches a class name, possibly containing any number of package separators---works. The caveat is, use of, e.g., extra**, will keep all the sub packages as well. :( We'll prepare the fix soon.
R8 currently regards <package_filter> in that directive as <class_filter>. That's why single asterisk---a class name not containing the package separator---doesn't work for now, whereas double asterisks---matches a class name, possibly containing any number of package separators---works. The caveat is, use of, e.g., extra**, will keep all the sub packages as well. :( We'll prepare the fix soon.
mz...@google.com <mz...@google.com> #3
Project: r8
Branch: master
commit a9a9e7d1231726094c6e16c2cef1bad887da3bba
Author: Jinseong Jeon <jsjeon@google.com>
Date: Tue Apr 09 11:49:28 2019
Reproduce b/130135768 : keeppackagenames with asterisks
Bug: 130135768
Change-Id: I5ab1cdb5148a570a63bdd488358759bb33da700a
M src/test/java/com/android/tools/r8/TestShrinkerBuilder.java
A src/test/java/com/android/tools/r8/naming/KeepPackageNamesTest.java
A src/test/java/com/android/tools/r8/naming/keeppackagenames/Top.java
A src/test/java/com/android/tools/r8/naming/keeppackagenames/sub/SubClass.java
https://r8-review.googlesource.com/36860
Branch: master
commit a9a9e7d1231726094c6e16c2cef1bad887da3bba
Author: Jinseong Jeon <jsjeon@google.com>
Date: Tue Apr 09 11:49:28 2019
Reproduce
Bug: 130135768
Change-Id: I5ab1cdb5148a570a63bdd488358759bb33da700a
M src/test/java/com/android/tools/r8/TestShrinkerBuilder.java
A src/test/java/com/android/tools/r8/naming/KeepPackageNamesTest.java
A src/test/java/com/android/tools/r8/naming/keeppackagenames/Top.java
A src/test/java/com/android/tools/r8/naming/keeppackagenames/sub/SubClass.java
to...@unicepta.com <to...@unicepta.com> #4
Project: r8
Branch: master
commit 391e2992aee375adf46edbb5e7b098556c8604ed
Author: Søren Gjesse <sgjesse@google.com>
Date: Fri Apr 12 11:05:43 2019
New implementation of -keeppackagenames
This implementation collects the list of package names given for
-keeppackagenames and matches against that in the minifier.
The previous implementation created class matching rules to piggybag
on the existing matching.
Bug: 130135768
Change-Id: I5a341e145747a5dec8788a066a0c67d4e259ec77
M src/main/java/com/android/tools/r8/graph/DexType.java
M src/main/java/com/android/tools/r8/naming/ClassNameMinifier.java
M src/main/java/com/android/tools/r8/shaking/ProguardConfiguration.java
M src/main/java/com/android/tools/r8/shaking/ProguardConfigurationParser.java
D src/main/java/com/android/tools/r8/shaking/ProguardKeepPackageNamesRule.java
A src/main/java/com/android/tools/r8/shaking/ProguardPackageMatcher.java
A src/main/java/com/android/tools/r8/shaking/ProguardPackageNameList.java
M src/main/java/com/android/tools/r8/shaking/RootSetBuilder.java
M src/test/java/com/android/tools/r8/naming/KeepPackageNamesTest.java
M src/test/java/com/android/tools/r8/shaking/ProguardConfigurationParserTest.java
A src/test/java/com/android/tools/r8/shaking/ProguardPackageNameMatcherTest.java
https://r8-review.googlesource.com/36944
Branch: master
commit 391e2992aee375adf46edbb5e7b098556c8604ed
Author: Søren Gjesse <sgjesse@google.com>
Date: Fri Apr 12 11:05:43 2019
New implementation of -keeppackagenames
This implementation collects the list of package names given for
-keeppackagenames and matches against that in the minifier.
The previous implementation created class matching rules to piggybag
on the existing matching.
Bug: 130135768
Change-Id: I5a341e145747a5dec8788a066a0c67d4e259ec77
M src/main/java/com/android/tools/r8/graph/DexType.java
M src/main/java/com/android/tools/r8/naming/ClassNameMinifier.java
M src/main/java/com/android/tools/r8/shaking/ProguardConfiguration.java
M src/main/java/com/android/tools/r8/shaking/ProguardConfigurationParser.java
D src/main/java/com/android/tools/r8/shaking/ProguardKeepPackageNamesRule.java
A src/main/java/com/android/tools/r8/shaking/ProguardPackageMatcher.java
A src/main/java/com/android/tools/r8/shaking/ProguardPackageNameList.java
M src/main/java/com/android/tools/r8/shaking/RootSetBuilder.java
M src/test/java/com/android/tools/r8/naming/KeepPackageNamesTest.java
M src/test/java/com/android/tools/r8/shaking/ProguardConfigurationParserTest.java
A src/test/java/com/android/tools/r8/shaking/ProguardPackageNameMatcherTest.java
Description
I have to set up an FTP server in a GCP Kubernetes cluster, and want to route clients so that multiple requests from the same IP to different ports get routed to the same Kubernetes pod.
However, when I set up a service of type load balancer with session affinity set to ClientIP, the requests get distributed to different nodes.
(Background)
In the (passive) FTP protocol, the server opens up a new port, and sends the port number to the client. The client then creates a new connection to that port. Hence, I need to ensure that the second request gets routed to the same pod, because only on that pod a server is waiting for a new connection.
What you expected to happen:
Subsequent requests from the same IP should get forwarded to the same pod.
Steps to reproduce:
I tried a minimal sample with a workload of two pods that have only a container with netcat installed, and have the ports 21, and 30000-30098 exposed. Then, I set up service of type LoadBalancer as follows (reduced to the relevant portions):
kind: Service
spec:
type: LoadBalancer
sessionAffinity: ClientIP
loadBalancerIP: IP_OF_LB
ports:
- name: ftp-control
port: 21
protocol: TCP
targetPort: 21
- name: pasv-30000
port: 30000
protocol: TCP
targetPort: 30000
# and so on for the remaining ports up to 30098
Now I log onto each of the pods with a shell, and I start to listen manually on one port as follows:
netcat -l -p 30001
Then, I use telnet from my workstation to connect to the IP address of the load balancer.
telnet IP_OF_LB 30001
This way, I can see which pod gets the incoming connection request.
For each port, the requests always get forwarded to the same node, so the session affinity seems to work there. However, I would expect to be the target node to be stable across all ports.