+
    jHàjK  ã                   ó‚   € R t ^ RIt^ RIt^ RIHt ^ RIHt ]P                  ! ]4      t	R t
R tR tRR/R	 ltR
 tR tR# )aI  A local receipt's compression catch-up (#140060), committed off the owner loop.

``adopt_untracked_compression`` takes the writer lock, up to ``_WRITE_PATIENCE_S`` when contended. On
the owner loop that stalls every profile it serves (streams, controls, admissions), including during
a hot-profile activation. So the async paths that restore a receipt (boot and hot-profile recovery, a
socket's first read) commit the catch-up in a worker first, and the restore that follows only reads.
A restore reached synchronously on the loop hands it to a tracked worker (``schedule_adoption``).
N)Úpartial)ÚRuntimeStoreErrorc                  óV   €  \         P                  ! 4        R#   \         d     R # i ; i)FT)ÚasyncioÚget_running_loopÚRuntimeError© ó    ÚC/home/ubuntu/.hermes/hermes-agent/gateway/session_local_adoption.pyÚon_owner_loopr      s,   € ðÜ× Ò Ô"ñ øô ô Úðús   ‚ ™(§(c                ó  € ^ RI Hp ^ RIHp  V! W4      ^ ,          pV P                  P                  4       ;_uu_ 4       pV! WT4      e   TMRuuRRR4       #   + '       g   i     R# ; i  \        \        \        \        3 d     R# i ; i)z_*sid*'s stored receipt when a catch-up would commit for it on this owner, else None. Read-only.)Úowned_receipt)Úadoptable_compressionN)
Úgateway.session_local_recoveryr   Úhermes_state_local_lineager   ÚdbÚ	_read_ctxÚKeyErrorÚ	TypeErrorÚ
ValueErrorÚAttributeError)Ú	authorityÚsidr   r   ÚreceiptÚconns   &&    r
   Ú_duer      sj   € å<Ý@ðÙ 	Ó/°Õ2ˆØ�\‰\×#Ñ#×%Ô%¨Ù3°DÓBÒN‘7ÐTX÷ &×%×%Ó%ûä”i¤¬^Ð<ô Úðús.   Ž1A, ¿AÁ
A, ÁA)	Á#A, Á)A, Á,BÂ
Bc                 óP   € ^ RI Hp V! V P                  V P                  WR7       R# )é    )Úadopt_untracked_compression)ÚepochÚ
session_idÚexpectedN)r   r   r   r   )r   r   r   r   s   &&& r
   Ú_adoptr"   &   s   € ÝFÙ 	§¡°I·O±OÐPS×fr	   ÚtrackedTc             ƒ  óJ  "  € \        W4      pVf   R# \        \        WV4      p V'       d   ^ RIHp V! W4      G Rj  x€L
  R# \
        P                  ! V4      G Rj  x€L
  R#  L& L  \         d,   p\        P                  RYP                  4        Rp?R# Rp?ii ; i5i)z®Commit *sid*'s due catch-up in a worker, so the restore that follows only reads.

``tracked=False``: an authority still being built, not yet published for retirement to join.N)Útracked_writez0Local session %s compression catch-up failed: %s)r   r   r"   Úgateway.session_runtime_workersr%   r   Ú	to_threadr   ÚloggerÚwarningÚreason)r   r   r#   r   Úwriter%   Úexcs   &&$    r
   Úadopt_before_restorer-   +   s†   é € ô �9Ó"€GØ‚ÙÜ”F˜I¨GÓ4€Eð\ßÝEÙ 	Ó1×1Ò1ä×#Ò# EÓ*×*Ò*ñ 2á*øÜô \Ü�‰ÐIÈ3×PZÑPZ×[Ò[ûð\üs]   ‚#B#¦A* ¿A&Á A* ÁB#ÁA* ÁA(Á A* Á$B#Á&A* Á(A* Á*B Á5 BÂB#ÂB Â B#c              ƒ  óf   "  € ^ RI Hp V! V 4       F  p\        WRR7      G Rj  x€L
  K  	  R#  L
5i)z_Boot and hot-profile recovery: every receipt's due catch-up, before ``recover_local_sessions``.)Úlocal_receipt_idsF)r#   N)r   r/   r-   )r   r/   r   s   &  r
   Úadopt_local_compressionsr0   =   s*   é € å@Ù  Ö+ˆÜ" 9¸5ÔA×AÒAó ,ÙAùs   ‚"1¤/¥1c                óö   a aa€ ^ RI Hp \        S RR4      pVf
   / ;pS n        SV9   d    VS,          P	                  4       '       g   R# \
        P                  RS4       V VV3R lpV! S V! 4       4      VS&   R# )z§A sync restore on the owner loop found *receipt*'s catch-up due: commit it in a tracked worker,
then publish the session on the loop. One worker per session at a time.)Útrack_mutationÚ_local_adoptionsNzHLocal session %s: committing its compression catch-up off the owner loopc               “   ó  <"  €  \         P                  ! \        SSS4      G R j  x€L
  \        SRR4      '       g   ^ RIHp  V ! SS4       R # R #  L*  \         d-   p\        P                  RSTP                  4        R p?R # R p?ii ; i5i)NÚretiringF)Úrestore_local_sessionz:Local session %s paused after its compression catch-up: %s)
r   r'   r"   Úgetattrr   r6   r   r(   r)   r*   )r6   r,   r   r   r   s     €€€r
   Úadopt_then_publishÚ-schedule_adoption.<locals>.adopt_then_publishO   s|   øé € ð	jÜ×#Ò#¤F¨I°s¸GÓD×DÐDÜ˜9 j°%×8Ò8ÝPÙ% i°Ö5ñ 9ñ Eøô !ô 	jÜ�N‰NÐWÐY\Ð^a×^hÑ^h×iÒiûð	jüs>   ƒB… A ¥A¦&A ÁBÁA ÁB	Á!BÁ>BÂB	Â	B)r&   r2   r7   r3   Údoner(   Úinfo)r   r   r   r2   Úpendingr8   s   fff   r
   Úschedule_adoptionr=   D   sq   ú€ õ ?Ü�iÐ!3°TÓ:€GØ‚Ø/1Ð1ˆ�)Ô,Ø
ˆg„~˜g c�l×/Ñ/×1Ò1ÙÜ
‡K�KÐZÐ\_Ô`÷jñ " )Ñ-?Ó-AÓB€GˆCƒLr	   )Ú__doc__r   ÚloggingÚ	functoolsr   Úhermes_state_runtimer   Ú	getLoggerÚ__name__r(   r   r   r"   r-   r0   r=   r   r	   r
   Ú<module>rD      sR   ðñó Û Ý å 2à	×	Ò	˜8Ó	$€òò	ògð
\¸$ô \ò$BôCr	   