flomesh-io / pipy

Pipy is a programmable proxy for the cloud, edge and IoT.
https://flomesh.io/pipy
Other
743 stars 70 forks source link

[filter] pipeline get stuck in the `demux()` filter #91

Closed ethinx closed 1 year ago

ethinx commented 1 year ago

At the out req posistion, nothing output to the subsequent pipeline. The scripts works in the version 0.30.0-184

pipy()

.listen(8000)
  .link('forward')

.pipeline('forward')
  .decodeHTTPRequest()
  .dump('before req')
  .demux('req')
  .dump('out req')
  .muxHTTP('connection', ()=>'')
  .encodeHTTPResponse()

.pipeline('req')
  .handleMessage(
    msg=>(
      console.log("do nothing")
    )
  )
  .dump('end req')

.pipeline('connection')
  .connect('localhost:8080')

.listen(8080)
.serveHTTP(
    msg=>(
      new Message('hello\n') 
    )
  )

Version:

Version     : nightly-202207151451
Commit      : 1d835d44c571634e8e99bfda1890e56e16f0968e
Commit Date : Thu, 14 Jul 2022 21:13:30 +0800
Host        : Darwin-21.5.0 arm64
OpenSSL     : OpenSSL 1.1.1q  5 Jul 2022
Builtin GUI : No
Tutorial    : No

Expected result:

curl http://localhost:8000 and return hello

pajama-coder commented 1 year ago

It was a breaking change in the latest version: demux() by itself outputs nothing while it did output its sub pipelines' output in v0.30.0. For the old script to continue working, demux() needs to be changed to demuxQueue().