fifo icon indicating copy to clipboard operation
fifo copied to clipboard

Resize fifo to 1024K

Open kkkkun opened this issue 1 year ago • 6 comments

The container which writes logs synchronously would be blocked in the following scenarios:

  1. Container writes logs synchronously to stdout or stderr .
  2. Upgrade containerd and speed a lot of time.

So it is important to resize fifo in container runtime. After commit, the pipe_max_size had adjusted to 1024K.

kkkkun avatar Mar 20 '24 12:03 kkkkun

/assign @thaJeztah

kkkkun avatar Jul 17 '24 12:07 kkkkun

The failed tests seem not to be related to the change.

kkkkun avatar Jul 18 '24 06:07 kkkkun

The failed tests seem not to be related to the change.

Hm.. interesting; linting failure I suspect is because of an old version of GolangCI-lint, which is not yet aware of the max builtin? Not sure why that only shows up now.

Running [/home/runner/golangci-lint-1.51.1-linux-amd64/golangci-lint run --out-format=github-actions --path-prefix=src/github.com/containerd/fifo] in [/home/runner/work/fifo/fifo/src/github.com/containerd/fifo] ...
  Error: undefined: max (typecheck)
  
  Error: issues found

Don't know about the other one (I'm not too familiar with all of this repository);

=== RUN   TestFifoCloseWhileReadingAndWriting
    fifo_test.go:450: 
        	Error Trace:	/home/runner/work/fifo/fifo/src/github.com/containerd/fifo/fifo_test.go:450
        	Error:      	An error is expected but got nil.
        	Test:       	TestFifoCloseWhileReadingAndWriting
    fifo_test.go:454: Read should not succeed
--- FAIL: TestFifoCloseWhileReadingAndWriting (0.50s)

thaJeztah avatar Jul 18 '24 11:07 thaJeztah

Can you rebase your PR? https://github.com/containerd/fifo/pull/58 should have fixed the CI failures

thaJeztah avatar Jul 18 '24 23:07 thaJeztah

Can you rebase your PR? #58 should have fixed the CI failures

Done. I do not understand the failed test.

=== RUN   TestFifoCloseWhileReadingAndWriting
    fifo_test.go:450: 
        	Error Trace:	/home/runner/work/fifo/fifo/src/github.com/containerd/fifo/fifo_test.go:450
        	Error:      	An error is expected but got nil.
        	Test:       	TestFifoCloseWhileReadingAndWriting
    fifo_test.go:454: Read should not succeed
--- FAIL: TestFifoCloseWhileReadingAndWriting (0.50s)

kkkkun avatar Jul 22 '24 11:07 kkkkun

It's a shame that the api surface returns a ReadWriteCloser directly, otherwise I'd say why don't we just expose a method that lets you set the buffer size to whatever you want. Alternatively, we could expose a new constructor, like OpenFifoWithOpts() where we can pass in options to control things like this. My opinion is it should be the users choice, and we shouldn't automatically set the buf size for them if possible.

dcantah avatar May 06 '25 07:05 dcantah