From 9e51ab7e8ddb742a403444cc89a08cbad56dcfee Mon Sep 17 00:00:00 2001 From: Mikhail Khorkov Date: Mon, 22 Jun 2020 12:51:05 +0700 Subject: [PATCH 1/3] #2 Fix concurrency issue Previously you may face error messages like 'This continuation has already been invoked [...] line 143' or 'Use of uninitialized value of type Mu in string context. [...] line 112'. It appears because of laziness of the sequence operator for $digits list in the Pattern package. Now the sequence operator is changed to explicit list initialization. --- .gitignore | 3 ++- lib/LogP6/WriterConf/Pattern.pm6 | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7e61b01..8f1ceee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ **/.idea/ **/.precomp/ -**/*.iml \ No newline at end of file +**/*.iml +**/.DS_Store \ No newline at end of file diff --git a/lib/LogP6/WriterConf/Pattern.pm6 b/lib/LogP6/WriterConf/Pattern.pm6 index 6e209d6..156a50f 100644 --- a/lib/LogP6/WriterConf/Pattern.pm6 +++ b/lib/LogP6/WriterConf/Pattern.pm6 @@ -102,7 +102,9 @@ class XTrace does PatternPart { method show($x) { $x.backtrace } } -my $digits = ('00', '01' ... '99').List; +# use explicit initialization (without sequence operator for example) +# to avoid laziness which can lead to concurrency issues +my $digits = <00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99>.List; my $months = <0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec>.List; class Date does PatternPart { From 1340c2a06414eded4c93f906f39bc37a4f493230 Mon Sep 17 00:00:00 2001 From: Mikhail Khorkov Date: Mon, 22 Jun 2020 12:59:40 +0700 Subject: [PATCH 2/3] Bump version --- META6.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/META6.json b/META6.json index 57ee25e..fac5343 100644 --- a/META6.json +++ b/META6.json @@ -1,7 +1,7 @@ { "name": "LogP6", "description": "Full customisable logging library inspired by idea of separate logging and its configuration.", - "version": "1.6.1", + "version": "1.6.2", "perl": "6.d", "authors": [ "Mikhail Khorkov" From 37379b2e017fa0920138d9518838c296b2b96359 Mon Sep 17 00:00:00 2001 From: Mikhail Khorkov Date: Mon, 22 Jun 2020 13:05:09 +0700 Subject: [PATCH 3/3] Update Changes --- Changes | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Changes b/Changes index 3dbad90..2259aa2 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Version history: +1.6.2 2020-06-22 'fix concurrency issue' + - fix concurrency issue with laziness of the sequence operator + 1.6.1 2019-04-29 'conditional log calls' - add methods info-on, error-on or so to check will a log will be written - separate sprintf-slyte and contatenation-slyte logs into separate methods