Skip to content

Comments

[edge] Fixed UnicodeDecodeError during log file upload of Edge worker#43954

Merged
jscheffl merged 3 commits intoapache:mainfrom
boschglobal:bugfix/edge-worker-log-handling-none-utf8
Nov 13, 2024
Merged

[edge] Fixed UnicodeDecodeError during log file upload of Edge worker#43954
jscheffl merged 3 commits intoapache:mainfrom
boschglobal:bugfix/edge-worker-log-handling-none-utf8

Conversation

@AutomationDev85
Copy link
Contributor

Description

Edge worker runs into UnicodeDecodeError exception during log file upload. The Worker reads log file as string and counts number of string characters to seek into the file during uploading next log file part. This can result in mismatch between number of bytes and number of string characters if log file contains none UTF-8 characters. So during upload of next log file part worker can jump between 2 bytes of none utf-8 characters and crashes. Edge worker now uses read bytes to calc place to seek into and decode string as UTF-8 to handle none UTF-8 charaters.

Details about changes

  • Worker reads log file as byte string to calc number of read bytes to seek in.
  • Worker decode byte string to UTF-8
  • Changed unit tests to test none UTF-8 log file.

@AutomationDev85 AutomationDev85 force-pushed the bugfix/edge-worker-log-handling-none-utf8 branch from 31ffdbb to dc7f2ae Compare November 13, 2024 09:32
@AutomationDev85 AutomationDev85 changed the title [edge} Fixed UnicodeDecodeError during log file upload of Edge worker [edge] Fixed UnicodeDecodeError during log file upload of Edge worker Nov 13, 2024
@jscheffl jscheffl added type:bug-fix Changelog: Bug Fixes AIP-69 Edge Executor provider:edge Edge Executor / Worker (AIP-69) / edge3 labels Nov 13, 2024
@jscheffl jscheffl merged commit 00ef940 into apache:main Nov 13, 2024
ellisms pushed a commit to ellisms/airflow that referenced this pull request Nov 13, 2024
…apache#43954)

* Fixed seeking issue with none utf-8 signs

* Changed version and changelog

* Removed hard utf-8 decoding

---------

Co-authored-by: Marco Küttelwesch <marco.kuettelwesch@de.bosch.com>
amoghrajesh pushed a commit to astronomer/airflow that referenced this pull request Nov 14, 2024
…apache#43954)

* Fixed seeking issue with none utf-8 signs

* Changed version and changelog

* Removed hard utf-8 decoding

---------

Co-authored-by: Marco Küttelwesch <marco.kuettelwesch@de.bosch.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIP-69 Edge Executor area:providers provider:edge Edge Executor / Worker (AIP-69) / edge3 type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants