in reply to Threads, Tk, Time, oh my!
It seems that in your code, the only (relevant?) use of Time::Piece is in PM::CB::Communication for the timestamp. But you only use Time::Piece there to parse the incoming create time and convert it to some other string. This should be fairly safe, but maybe mod:://Time::Piece runs afoul of setting/resetting timezones or locale data between threads.
Does the problem go away if you switch from Time::Piece to POSIX::strftime and manually convert the string (resp. replace the string with a hardcoded dummy)?
if (@nodes) { $self->{to_gui}->enqueue( [private => '<pm-cb-g>', 'Time::Piece'->strptime($_->{createtime}, '%Y%m%d%H%M%S') ->strftime('%Y-%m-%d %H:%M:%S'), "New node: [id://$_->{node_id}|" . $_->textContent =~ s/\n//r . '] by [id://' . "$_->{author_user}|$_->{authortitle} +]", NOT_DELETABLE]) for grep ! exists $nodes{ $_->{node_id} }, reverse @no +des; @nodes{ map $_->{node_id}, @nodes} = (); }
Alternatively, you can maybe try to run your code with $ENV{LANG}='C' or $ENV{LC_TIME}='C', or whatever is used to reset the information there... If that "helps", this points towards a locale handling bug/conflict between threads and Time::Piece, but that's where my ideas end.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Threads, Tk, Time, oh my!
by choroba (Cardinal) on May 07, 2026 at 09:45 UTC | |
by Corion (Patriarch) on May 07, 2026 at 09:53 UTC |