[ 
https://issues.apache.org/jira/browse/FLINK-17611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17106405#comment-17106405
 ] 

Igal Shilman commented on FLINK-17611:
--------------------------------------

Thanks [~slinkydeveloper].

If okhttp client works out, then here is a proposal of how we can incorporate 
unix domain sockets:
 * You will need to add a  "uds" key for the http function spec, that 
represents the unix domain socket path. Here is an example snippet of an HTTP 
function spec with the uds key.
{code:java}
 - function:
    meta:
      kind: http
      ...
    spec:
      endpoint: http://foobar.com/statefun
      uds: /mnt/shared/statefun.sock
      states:
        ...
      ...{code}

 * Add a field at 
[HttpFunctionSpec.java|https://github.com/apache/flink-statefun/blob/master/statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/httpfn/HttpFunctionSpec.java]
 for the unix domain socket path.
 * Populate this field at 
[JsonModule.java|https://github.com/apache/flink-statefun/blob/master/statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/jsonmodule/JsonModule.java#L255]
 * And 
[here|https://github.com/apache/flink-statefun/blob/master/statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/httpfn/HttpFunctionProvider.java#L47]
 you would be able to set a different socket factory if the 
unixDomainSocketPath is present.

What remains to be figured out is, what do we do if the socket file isn't there 
yet.

Regarding a contribution guide: we are using a [Flink contribution 
guide|https://flink.apache.org/contributing/contribute-code.html] with some 
exceptions to the code style here and there, for example we are using Google 
code style 1.7, enforced with spotless (instead of check style)

 

Can I assign you to this ticket?

 

 

> Support unix domain sockets for sidecar communication in Stateful Functions
> ---------------------------------------------------------------------------
>
>                 Key: FLINK-17611
>                 URL: https://issues.apache.org/jira/browse/FLINK-17611
>             Project: Flink
>          Issue Type: New Feature
>          Components: Stateful Functions
>            Reporter: Francesco Guardiani
>            Priority: Major
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> Hi all,
> I'm quite new to this project and I've started investigating its potential 
> usage in Kubernetes.
> I've found in past that using Unix Domain Sockets across several containers 
> in the same pod gives an interesting performance boost and drastically 
> reduces the overhead of going through the network stack. Given that 
> containers in a pod run in the same host, it's perfectly reasonable to let 
> them communicate through unix domain sockets.
> If you're interested in such feature, I'm more than willing to help 
> implementing that, given that I need a few pointers where to start from



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to