Skip to content

Freezes silently on multithreading  #106

@michal-lukomski

Description

@michal-lukomski

Logger fails silently when logging from multithreaded for loop / map, can't communicate with logger afterward.
Julia default logger works well in a similar situation.

MWE:

using TensorBoardLogger
using Logging
tblogger = TBLogger("MWE_tblogger_threads", min_level=Logging.Info)

with_logger(tblogger) do
  for i in 1:10
    @info "blah" i^2
  end
  @info "finished sequential" finished=true
end # works well

with_logger(tblogger) do
  Threads.@threads for i in 1:10
    println(i^2) # no logging here
  end
  @info "finished threads" finished=true
end # works well too

with_logger(tblogger) do
  Threads.@threads for j in 1:10
    @info "blah" j^2
  end
  @info "finished threads" finished=false
end # silently fails, and doesn't log anything

with_logger(tblogger) do
  @info "can't communicate" something=1
end # can't communicate with logger afterward

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions