Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v8.0] fix (RSS): do not use timezone datetime #7761

Merged
merged 3 commits into from
Aug 27, 2024

Conversation

chaen
Copy link
Contributor

@chaen chaen commented Aug 25, 2024

As deprecated as it may be, DIRAC does not support timezone, and still needs utcnow

2024-08-25 19:13:47 UTC ResourceStatus/CacheFeederAgent/ResourceStatus/CacheFeederAgent ERROR: Failed to execute command, with exception: FreeDiskSpace
Traceback (most recent call last):
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/ResourceStatusSystem/Agent/CacheFeederAgent.py", line 135, in execute
    results = commandObject.doCommand()
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/ResourceStatusSystem/Command/Command.py", line 47, in doCommand
    return self.returnSObj(self.doMaster())
                           ^^^^^^^^^^^^^^^
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/ResourceStatusSystem/Command/FreeDiskSpaceCommand.py", line 195, in doMaster
    return self._cleanCommand()
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/ResourceStatusSystem/Command/FreeDiskSpaceCommand.py", line 206, in _cleanCommand
    res = self.rmClient.selectSpaceTokenOccupancyCache(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/ResourceStatusSystem/Client/ResourceManagementClient.py", line 751, in selectSpaceTokenOccupancyCache
    return self._getRPC().select("SpaceTokenOccupancyCache", prepareDict(columnNames, columnValues))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/DISET/RPCClient.py", line 36, in __call__
    return self.__doRPCFunc(self.__remoteFuncName, args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/DISET/RPCClient.py", line 82, in __doRPC
    return self.__innerRPCClient.executeRPC(sFunctionName, args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/DISET/private/InnerRPCClient.py", line 63, in executeRPC
    retVal = transport.sendData(S_OK(list(args)))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/DISET/private/Transports/BaseTransport.py", line 164, in sendData
    sCodedData = MixedEncode.encode(uData)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/Utilities/MixedEncode.py", line 17, in encode
    return DEncode.encode(inData)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/Utilities/DEncode.py", line 515, in encode
    g_dEncodeFunctions[type(uObject)](uObject, eList)
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/Utilities/DEncode.py", line 486, in encodeDict
    g_dEncodeFunctions[type(dValue[key])](dValue[key], eList)
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/Utilities/DEncode.py", line 430, in encodeList
    g_dEncodeFunctions[type(uObject)](uObject, eList)
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/Utilities/DEncode.py", line 486, in encodeDict
    g_dEncodeFunctions[type(dValue[key])](dValue[key], eList)
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/Utilities/DEncode.py", line 486, in encodeDict
    g_dEncodeFunctions[type(dValue[key])](dValue[key], eList)
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/Utilities/DEncode.py", line 430, in encodeList
    g_dEncodeFunctions[type(uObject)](uObject, eList)
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/Utilities/DEncode.py", line 370, in encodeDateTime
    g_dEncodeFunctions[type(tDateTime)](tDateTime, eList)
  File "/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/Utilities/DEncode.py", line 457, in encodeTuple
    g_dEncodeFunctions[type(uObject)](uObject, eList)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
KeyError: <class 'datetime.timezone'>

it would be easy to add timezone support in DEncode, but we would run into way more issues, so I think it's just not worth it

BEGINRELEASENOTES

*RSS
FIX: Do not use tinezone aware datetime

ENDRELEASENOTES

@DIRACGridBot DIRACGridBot added the alsoTargeting:integration Cherry pick this PR to integration after merge label Aug 25, 2024
@fstagni fstagni merged commit 62351f9 into DIRACGrid:rel-v8r0 Aug 27, 2024
26 checks passed
@DIRACGridBot DIRACGridBot added the sweep:done All sweeping actions have been done for this PR label Aug 27, 2024
DIRACGridBot pushed a commit to DIRACGridBot/DIRAC that referenced this pull request Aug 27, 2024
@DIRACGridBot
Copy link

Sweep summary

Sweep ran in https://github.com/DIRACGrid/DIRAC/actions/runs/10581412295

Successful:

  • integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alsoTargeting:integration Cherry pick this PR to integration after merge sweep:done All sweeping actions have been done for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants