From 5107b16794e6f3a774b998ce360dd5b7aceae0a9 Mon Sep 17 00:00:00 2001 From: Henrik Date: Wed, 13 Jun 2018 14:32:45 +0200 Subject: [PATCH] Seems #348 wasn't fully fixed: avoid throwing exceptions for now --- RELEASE_NOTES.md | 3 +++ examples/Libryy/LoggingV4.fs | 8 +++++--- src/Logary.Facade/Facade.fs | 8 +++++--- src/Logary/LoggerModule.fs | 8 +++++--- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 02a135c89..e3c64afb8 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +#### 5.0.0-beta.18 +* Ref #348 — wait for buffers - don't throw exceptions; push fix till later + #### 5.0.0-beta.17 * Fix #348 — wait for buffers diff --git a/examples/Libryy/LoggingV4.fs b/examples/Libryy/LoggingV4.fs index 305287850..b40be36c5 100644 --- a/examples/Libryy/LoggingV4.fs +++ b/examples/Libryy/LoggingV4.fs @@ -399,7 +399,8 @@ module Logger = | Result.Error Rejected -> Job.result () | Result.Error (BufferFull target) -> - Job.raises (exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target)) + //Job.raises (exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target)) + Job.result () /// Special case: e.g. Fatal messages. let logAck (logger: Logger) level messageFactory: Promise = @@ -411,8 +412,9 @@ module Logger = | Result.Error Rejected -> IVar.fill ack () | Result.Error (BufferFull target) -> - let e = exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target) - IVar.fillFailure ack e + //let e = exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target) + //IVar.fillFailure ack e + IVar.fill ack () start inner ack :> Promise<_> diff --git a/src/Logary.Facade/Facade.fs b/src/Logary.Facade/Facade.fs index 659f5edf3..927e6d873 100644 --- a/src/Logary.Facade/Facade.fs +++ b/src/Logary.Facade/Facade.fs @@ -399,7 +399,8 @@ module Logger = | Result.Error Rejected -> Job.result () | Result.Error (BufferFull target) -> - Job.raises (exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target)) + //Job.raises (exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target)) + Job.result () /// Special case: e.g. Fatal messages. let logAck (logger: Logger) level messageFactory: Promise = @@ -411,8 +412,9 @@ module Logger = | Result.Error Rejected -> IVar.fill ack () | Result.Error (BufferFull target) -> - let e = exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target) - IVar.fillFailure ack e + //let e = exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target) + //IVar.fillFailure ack e + IVar.fill ack () start inner ack :> Promise<_> diff --git a/src/Logary/LoggerModule.fs b/src/Logary/LoggerModule.fs index c16b0d014..0a314589d 100644 --- a/src/Logary/LoggerModule.fs +++ b/src/Logary/LoggerModule.fs @@ -39,7 +39,8 @@ module Logger = | Result.Error Rejected -> Job.result () | Result.Error (BufferFull target) -> - Job.raises (exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target)) + //Job.raises (exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target)) + Job.result () /// Special case: e.g. Fatal messages. let logAck (logger: Logger) level messageFactory: Promise = @@ -51,8 +52,9 @@ module Logger = | Result.Error Rejected -> IVar.fill ack () | Result.Error (BufferFull target) -> - let e = exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target) - IVar.fillFailure ack e + //let e = exn (sprintf "logWithAck (true, _) should have waited for the RingBuffer(s) to accept the Message. Target(%s)" target) + //IVar.fillFailure ack e + IVar.fill ack () start inner ack :> Promise<_>