Skip to content

Commit

Permalink
Release v0.14.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jcass77 committed Dec 16, 2019
2 parents f043ef9 + fdbacbd commit 43652b9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
7 changes: 7 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

This changelog is used to track all major changes to WTFIX.

## v0.14.2 (2019-12-16)

**Fixes**

- Re-raise all exceptions that cause the pipeline to terminate abnormally so that they can be reported and dealt
with at the operating system level. Useful if pipeline is being monitored by something like supervisord.


## v0.14.1 (2019-11-27)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="wtfix",
version="0.14.1",
version="0.14.2",
author="John Cass",
author_email="john.cass77@gmail.com",
description="The Pythonic Financial Information eXchange (FIX) client for humans.",
Expand Down
19 changes: 10 additions & 9 deletions wtfix/apps/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,24 +210,25 @@ async def listen(self):
data
) # Process logout message in the pipeline as per normal

asyncio.create_task(self.pipeline.stop())

return # Stop trying to listen for more messages.

else:
logger.error(
f"{self.name}: Unexpected EOF waiting for next chunk of partial data "
f"'{utils.decode(e.partial)}'. Initiating shutdown..."
f"'{utils.decode(e.partial)}' ({e})."
)
asyncio.create_task(self.pipeline.stop())

return
raise e

except LimitOverrunError:
except LimitOverrunError as e:
# Buffer limit reached before a complete message could be read - abort!
logger.exception(
f"{self.name}: Stream reader buffer limit exceeded! Initiating shutdown..."
logger.error(
f"{self.name}: Stream reader buffer limit exceeded! ({e})."
)

asyncio.create_task(self.pipeline.stop())

return # Stop trying to listen for more messages.
raise e

async def on_send(self, message):
"""
Expand Down
3 changes: 2 additions & 1 deletion wtfix/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ async def _process_message(self, message, direction):

except Exception as e:
if (
isinstance(Exception, ConnectionError)
isinstance(e, ConnectionError)
and message.type == connection.protocol.MsgType.Logout
and self.stopping_event.is_set()
):
Expand All @@ -218,6 +218,7 @@ async def _process_message(self, message, direction):
f"Unhandled exception while doing {method_name}: {e} ({message})."
)
await self.stop() # Block while we try to stop the pipeline
raise e

return message

Expand Down

0 comments on commit 43652b9

Please sign in to comment.