log-foundry 0.10.2.dev9__tar.gz → 0.10.2.dev10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/PKG-INFO +1 -1
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/pyproject.toml +1 -1
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/_diag.py +6 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/worker.py +19 -1
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/LICENSE +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/README.md +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/__init__.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/api.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/config.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/console.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/context.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/decorator.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/ids.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/model.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/py.typed +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sanitize.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/__init__.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/_batch.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/_chunk.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/_socket.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/_time.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/base.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/callback.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/clickhouse.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/datadog.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/elasticsearch.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/eventhubs.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/file.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/filtering.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/firehose.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/honeycomb.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/http.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/kafka.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/kinesis.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/logging_sink.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/logstash.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/loki.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/mongodb.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/multi.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/nats.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/newrelic.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/postgres.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/pubsub.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/rabbitmq.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/redis.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/sentry.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/sns.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/splunk.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/sqlite.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/sqs.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/stdout.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/syslog.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/transform.py +0 -0
- {log_foundry-0.10.2.dev9 → log_foundry-0.10.2.dev10}/src/log_foundry/sinks/util.py +0 -0
|
@@ -19,6 +19,12 @@ Two rules, both load-bearing:
|
|
|
19
19
|
as everywhere else in this library: a ``KeyboardInterrupt`` landing mid-write is the operator's
|
|
20
20
|
intent, not a stream fault to swallow.
|
|
21
21
|
|
|
22
|
+
**This module must import nothing from its own package.** ``decorator``, ``api`` and ``worker``
|
|
23
|
+
all reach it with ``from log_foundry import _diag`` at module scope, which executes while the
|
|
24
|
+
package is still partially initialised and resolves only because ``_diag`` is a leaf — it needs
|
|
25
|
+
``sys`` and nothing else. Give it an intra-package import and every module that is imported
|
|
26
|
+
*first* in a fresh interpreter starts failing.
|
|
27
|
+
|
|
22
28
|
SPEC-029 takes ownership of this module and moves the ``repr(exception)`` sink sites onto it.
|
|
23
29
|
"""
|
|
24
30
|
|
|
@@ -25,6 +25,8 @@ import threading
|
|
|
25
25
|
import time
|
|
26
26
|
from typing import TYPE_CHECKING, NamedTuple, cast
|
|
27
27
|
|
|
28
|
+
from log_foundry import _diag
|
|
29
|
+
|
|
28
30
|
if TYPE_CHECKING:
|
|
29
31
|
from log_foundry.sinks.base import Sink
|
|
30
32
|
|
|
@@ -244,6 +246,17 @@ class Worker:
|
|
|
244
246
|
|
|
245
247
|
Idempotent: a second call is a no-op (FR-005). Registered via ``atexit`` by the
|
|
246
248
|
decorator's lazy worker so a program that logs and exits immediately still flushes.
|
|
249
|
+
|
|
250
|
+
**Total** (SPEC-025 FR-004). The close was unguarded, so a sink whose ``close()`` failed
|
|
251
|
+
raised out of ``shutdown()`` — and out of the ``atexit`` handler, where CPython printed
|
|
252
|
+
"Exception ignored in atexit callback" with a full traceback carrying the exception's
|
|
253
|
+
message, which arch §6 keeps out of anything the library says about itself.
|
|
254
|
+
|
|
255
|
+
The once-only flag deliberately stays *ahead* of the close rather than moving after it.
|
|
256
|
+
Re-running a drain is not safe, and a second ``shutdown()`` retrying a close that already
|
|
257
|
+
failed would call ``close()`` twice on a sink that may have partially released its
|
|
258
|
+
resources. Idempotence is preserved; what changes is that the failure is announced rather
|
|
259
|
+
than swallowed by the flag.
|
|
247
260
|
"""
|
|
248
261
|
with self._lock:
|
|
249
262
|
if self._shutdown_done:
|
|
@@ -255,7 +268,12 @@ class Worker:
|
|
|
255
268
|
except queue.Full:
|
|
256
269
|
pass
|
|
257
270
|
self._thread.join()
|
|
258
|
-
|
|
271
|
+
try:
|
|
272
|
+
self.sink.close()
|
|
273
|
+
except Exception as exc:
|
|
274
|
+
# After the join, so everything queued has already been drained and emitted: what is
|
|
275
|
+
# lost here is the sink's own cleanup, not events.
|
|
276
|
+
_diag.absorbed("closing the sink", exc, "it may still hold its resources")
|
|
259
277
|
|
|
260
278
|
# -- worker thread ------------------------------------------------------------------
|
|
261
279
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|