wavesplatform / nodemon

Waves nodes monitoring service
MIT License
7 stars 0 forks source link

[BUG] Fix errors with zap Sync method. #116

Open nickeskov opened 2 years ago

nickeskov commented 2 years ago

Describe the bug Sync method of zap returns error sync /dev/stderr: inappropriate ioctl for device. Also the strange behavior appears in tests: sync /dev/stderr: bad file descriptor.

To Reproduce Steps to reproduce the behavior:

  1. Run nodemon any other binary from this repo. And to reproduce the second error run
  2. Send interrupt signal to the running process or wait till the end of a test.
  3. And we see the error message

Expected behavior No error.

Desktop (please complete the following information):

Additional context TestAnalyzer_analyzeStateHash test log:

=== RUN   TestAnalyzer_analyzeStateHash
=== RUN   TestAnalyzer_analyzeStateHash/TestCase#1
# .................. rows omitted
2022-10-19T01:23:24.318+0300    INFO    analysis/analyzer.go:154    On polling complete of 2 nodes
2022-10-19T01:23:24.318+0300    INFO    analysis/analyzer.go:160    Total statemetns count: 8
2022/10/19 01:23:24 sync /dev/stderr: bad file descriptor
--- PASS: TestAnalyzer_analyzeStateHash (0.00s)
    --- PASS: TestAnalyzer_analyzeStateHash/TestCase#1 (0.00s)
PASS

Nodemon log:

2022-10-19T01:28:09.400+0300    INFO    analysis/analyzer.go:154        On polling complete of 1 nodes
2022-10-19T01:28:09.400+0300    INFO    scraping/scraper.go:83  Polling of 1 nodes completed with 3 events collected
2022-10-19T01:28:09.400+0300    INFO    analysis/analyzer.go:160        Total statemetns count: 1
2022-10-19T01:28:09.876+0300    INFO    nodemon/nodemon.go:185  shutting down
2022/10/19 01:28:09 sync /dev/stderr: inappropriate ioctl for device
nickeskov commented 2 years ago

See https://github.com/uber-go/zap/issues/991