nomad logs: output is incomplete and disordered

Created on 16 Apr 2018  路  1Comment  路  Source: hashicorp/nomad

Nomad version

reproduced it with 0.8 and 0.7.1

Issue

Running nomad logs multiple times for an allocation that wrote more then X KB of output
to STDOUT produces different results (even when the output isn't changing anymore).
Lines are missing and/or the output is disordered (line X+1 appears before line X).

This seems only to happen when the output of an allocation is bigger then a certain size (1004K of output is sufficient to reproduce it).

I expect that when an allocation is not printing anything new to STDOUT/STDERR that:

  • the output from nomad logs (starting from the offset) is exactly the same then alloc/logs/*.stdout.0, no missing lines, lines appear at the same offset,
  • running nomad logs multiple times always outputs the same

Reproduction steps

  • run a nomad job that produces >= 1004K of STDOUT output (less output may also be sufficient) and then sleep forever
  • run nomad logs multiple times, compare the output

mkdir -p /tmp/logs
for ((i=0;i<30;i++)); do nomad logs <ALLOC_ID> | tee /tmp/logs/$i; done
  • compare them, e.g. with md5sum and diff, most times not even 2 runs of the command produced the same output
themclient themlogging typbug

Most helpful comment

Thanks for the thorough report @fho! I was easily able to reproduce the bug. I ran log 10 times and it produced 3 distinct results. We'll look into it as soon as possible.

>All comments

Thanks for the thorough report @fho! I was easily able to reproduce the bug. I ran log 10 times and it produced 3 distinct results. We'll look into it as soon as possible.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

byronwolfman picture byronwolfman  路  3Comments

hamann picture hamann  路  3Comments

ashald picture ashald  路  3Comments

dvusboy picture dvusboy  路  3Comments

mlafeldt picture mlafeldt  路  3Comments