Open unit7-0 opened 3 years ago
Hi @unit7-0 and thanks for this report, sorry for the long time waiting. What you are saying has been "by-design" introduced here by @RayRoestenburg : https://github.com/lightbend/cloudflow/commit/55f022f3c96363712e59b3dfced54cc585020f78
I will double-check with him on what's the expected behavior. I see, anyhow, that we have most likely a bug here: https://github.com/lightbend/cloudflow/commit/55f022f3c96363712e59b3dfced54cc585020f78#diff-89d991b0c4bfbbd6d221723b70a341bba15274296e893417d710358da8296fd9R128 and here: https://github.com/lightbend/cloudflow/commit/55f022f3c96363712e59b3dfced54cc585020f78#diff-01d3a7c1e14d9d9f5cc6d61e91b7b89ea86087750afcf1f8690295de8e7efc2dR235
where endpointIdx
get's incremented and not used afterward.
Describe the bug When defining two streamlets extending AkkaServerStreamlet in separate pipeline modules, the same port(3000) is selected for both streamlets in runLocal mode. Accordingly, only one streamlet is running, which managed to occupy the free port. For another one, an error message appears in the logs:
[ERROR] [17:46:47.871] ak.io.TcpListener:159 Bind failed for TCP channel on endpoint [/0.0.0.0:3000] java.net.BindException: [/0.0.0.0:3000] Address already in use
To Reproduce Define two streamlets of the base type AkkaServerStreamlet in separate pipeline modules and try to run in local mode.
Expected behavior Both streamlets are running and bound to different ports.
Additional logs:
I suppose this is due to the fact that each module runs in a separate JVM, but the ports for server streamlets are selected in the local scope of the module relative to the base port offset: https://github.com/lightbend/cloudflow/blob/master/core/cloudflow-localrunner/src/main/scala/cloudflow/localrunner/LocalRunner.scala#L137