관리-도구
편집 파일: spark_worker.cpython-311.pyc
� R�Dg� � �� � d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dl m Z mZmZm Z mZ d dlmZ erd dlmZ d d lmZ d d lmZmZmZ G d� de� � Zd � Zd� Zd� ZdS )� )�absolute_importN)�configure_scope)�Hub)�Integration)�capture_internal_exceptions�exc_info_from_error�!single_exception_from_error_tuple�walk_exception_chain�event_hint_with_exc_info)�MYPY)�Any)�Optional)�ExcInfo�Event�Hintc �( � e Zd ZdZed� � � ZdS )�SparkWorkerIntegration�spark_workerc �* � dd l m} t | _ d S �Nr )�pyspark.daemon�daemon�_sentry_worker_main�worker_main)�original_daemons ��/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/sentry_sdk/integrations/spark/spark_worker.py� setup_oncez!SparkWorkerIntegration.setup_once s$ � � 1�0�0�0�0�0�&9��#�#�#� N)�__name__� __module__�__qualname__� identifier�staticmethodr � r r r r s2 � � � � � ��J��:� :� �\�:� :� :r r c � � |j }|j }ddd�}t | � � } | \ }}}g }t | � � D ]B\ }}}|t t t fvr&|� t |||||� � � � �C|rQ|� � � t | � � } dd|id�} t � � |� | | �� � d S d S )N�sparkF)�type�handled�error�values)�level� exception)�hint) �client�optionsr r � SystemExit�EOFError�ConnectionResetError�appendr �reverser �_tag_task_context� capture_event)�exc_info�hubr. �client_options� mechanism�exc_type� exc_value�tb�rvr- �events r �_capture_exceptionr@ $ s � � �Z�F��^�N� �U�3�3�I�"�8�,�,�H�&��H�i�� �B� $8��#A�#A� � ���)�R��J��2F�G�G�G��I�I�1��i��^�Y�� � � � �� � ,� � � ����'��1�1��!��2��?�?���������%�d��+�+�+�+�+�,� ,r c � �� ddl m� t � � 5 } | j �fd�� � }d d d � � d S # 1 swxY w Y d S )Nr )�TaskContextc � �� t � � 5 t j � t � � }�� � � }|�|�| cd d d � � S | � di � � � dt |� � � � � � � | d � dt |� � � � � � � | d � dt |� � � � � � � | d � dt |� � � � � � � |j r�d|j v rN| d � d|j d � � | d � d|j d � � d |j v r5| � di � � � d|j d � � d d d � � n# 1 swxY w Y | S ) N�tags�stageId�partitionId� attemptNumber� taskAttemptId�sentry_app_name�app_name�application_id�sentry_application_idzcallSite.short�extra�callSite) r r �current�get_integrationr �get� setdefault�strrE rF rG rH �_localProperties)r? r- �integration�task_contextrB s �r � process_eventz(_tag_task_context.<locals>.process_eventJ s` �� � -�.�.� � �!�k�9�9�:P�Q�Q��*���0�0���&�,�*>� � � � � � � � � � � � ���,�,�7�7��s�<�#7�#7�#9�#9�:�:�� � � �f� �(�(���L�<T�<T�<V�<V�8W�8W�X�X�X��f� �(�(�#�S��)C�)C�)E�)E�%F�%F�� � � �f� �(�(�#�S��)C�)C�)E�)E�%F�%F�� � � �0� �(�L�,I�I�I��f� �0�0�&��(E�FW�(X�� � � �f� �0�0�,�(�9�:Q�R�� � � (�<�+H�H�H��(�(��"�5�5�@�@�&��(E�FV�(W�� � �; � � � � � � � � � � ���� � � � �B �Ls �>G=�FG=�=H�H)�pyspark.taskcontextrB r �add_event_processor)�scoperW rB s @r r5 r5 D s� �� �/�/�/�/�/�/� � � � &�e� � "�# � # � # � # � #� "�# �&� &� &� &� &� &� &� &� &� &� &� &���� &� &� &� &� &� &s �6�:�:c �L � dd l m} |j | i |�� d S # t $ r� t j � t � � �Zt j }t j � � }t � � 5 t ||� � d d d � � Y d S # 1 swxY w Y Y d S Y d S w xY wr )�pyspark.worker�worker�mainr0 r rO rP r �sysr7 r r@ )�args�kwargs�original_workerr8 r7 s r r r q s � �,�,�,�,�,�,�2����d�-�f�-�-�-�-�-��� 2� 2� 2��;�&�&�'=�>�>�J��+�C��|�~�~�H�,�.�.� 2� 2�"�8�S�1�1�1� 2� 2� 2� 2� 2� 2� 2� 2� 2� 2� 2� 2� 2���� 2� 2� 2� 2� 2� 2� 2� K�J�J�2���s4 � �AB#�2B�B#�B �B#�B �B#�"B#)� __future__r r_ � sentry_sdkr �sentry_sdk.hubr �sentry_sdk.integrationsr �sentry_sdk.utilsr r r r r �sentry_sdk._typesr �typingr r r r r r r@ r5 r r$ r r �<module>rj s] �� &� &� &� &� &� &� � � � � &� &� &� &� &� &� � � � � � � /� /� /� /� /� /�� � � � � � � � � � � � � � #� "� "� "� "� "�� 7�������������6�6�6�6�6�6�6�6�6�6�:� :� :� :� :�[� :� :� :�,� ,� ,�@*� *� *�Z2� 2� 2� 2� 2r