0xPlaygrounds / subgrounds

An intuitive Python library for interfacing with subgraphs and GraphQL
http://docs.playgrounds.network
Apache License 2.0
49 stars 8 forks source link

SSL ResourceWarning thrown during normal operation #54

Open 0xMochan opened 5 months ago

0xMochan commented 5 months ago

Describe the bug Normally use Subgrounds via async or sync interface (using query grouping or not) and observe ResourceWarnings.

Expected behavior No ResourceWarning.

Screenshots

sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=1588, family=23, type=1, proto=0, laddr=('local_address'), raddr=('remote_address')>

Additional context This pesky problem was introduced during the async aubgrounds update. It can be safely ignored and even filterd out via the warnings module but ideally we don't have this lingering around.

import warnings                                                           

warnings.filterwarnings('ignore', category=ResourceWarning)

(Fixes #52)

  1. Figure out it's correlation between sync and async mode
    • I have a feeling it's because query grouping is great for async but a bit weird for sync when using the httpx library.
  2. Fix it for each mode