prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [xray] Users get no warning for infeasible tasks.
  Start Ray with 
  
  ```
  RAY_USE_XRAY=1 ray start --head --redis-port=6379 --num-gpus=0
  ```
  
  Then start `RAY_USE_XRAY=1 ipython` and run
  
  ```python
  import ray
  
  ray.init(redis_address='localhost:6379')
  
  @ray.remote(num_gpus=1)
  def f():
      return 1
  
  f.remote()
  ```
  
  `f` will never execute because it is infeasible, and yet the user will get no warning.
  
  </issue>
  <code>
  [start of python/ray/ray_constants.py]
  1 from __future__ import absolute_import
  2 from __future__ import division
  3 from __future__ import print_function
  4 """Ray constants used in the Python code."""
  5 
  6 import os
  7 
  8 import ray
  9 
  10 
  11 def env_integer(key, default):
  12     if key in os.environ:
  13         return int(os.environ[key])
  14     return default
  15 
  16 
  17 ID_SIZE = 20
  18 NIL_JOB_ID = ray.ObjectID(ID_SIZE * b"\x00")
  19 
  20 # If a remote function or actor (or some other export) has serialized size
  21 # greater than this quantity, print an warning.
  22 PICKLE_OBJECT_WARNING_SIZE = 10**7
  23 
  24 # The maximum resource quantity that is allowed. TODO(rkn): This could be
  25 # relaxed, but the current implementation of the node manager will be slower
  26 # for large resource quantities due to bookkeeping of specific resource IDs.
  27 MAX_RESOURCE_QUANTITY = 512
  28 
  29 # Different types of Ray errors that can be pushed to the driver.
  30 # TODO(rkn): These should be defined in flatbuffers and must be synced with
  31 # the existing C++ definitions.
  32 WAIT_FOR_CLASS_PUSH_ERROR = "wait_for_class"
  33 PICKLING_LARGE_OBJECT_PUSH_ERROR = "pickling_large_object"
  34 WAIT_FOR_FUNCTION_PUSH_ERROR = "wait_for_function"
  35 TASK_PUSH_ERROR = "task"
  36 REGISTER_REMOTE_FUNCTION_PUSH_ERROR = "register_remote_function"
  37 FUNCTION_TO_RUN_PUSH_ERROR = "function_to_run"
  38 VERSION_MISMATCH_PUSH_ERROR = "version_mismatch"
  39 CHECKPOINT_PUSH_ERROR = "checkpoint"
  40 REGISTER_ACTOR_PUSH_ERROR = "register_actor"
  41 WORKER_CRASH_PUSH_ERROR = "worker_crash"
  42 WORKER_DIED_PUSH_ERROR = "worker_died"
  43 PUT_RECONSTRUCTION_PUSH_ERROR = "put_reconstruction"
  44 HASH_MISMATCH_PUSH_ERROR = "object_hash_mismatch"
  45 
  46 # Abort autoscaling if more than this number of errors are encountered. This
  47 # is a safety feature to prevent e.g. runaway node launches.
  48 AUTOSCALER_MAX_NUM_FAILURES = env_integer("AUTOSCALER_MAX_NUM_FAILURES", 5)
  49 
  50 # The maximum number of nodes to launch in a single request.
  51 # Multiple requests may be made for this batch size, up to
  52 # the limit of AUTOSCALER_MAX_CONCURRENT_LAUNCHES.
  53 AUTOSCALER_MAX_LAUNCH_BATCH = env_integer("AUTOSCALER_MAX_LAUNCH_BATCH", 5)
  54 
  55 # Max number of nodes to launch at a time.
  56 AUTOSCALER_MAX_CONCURRENT_LAUNCHES = env_integer(
  57     "AUTOSCALER_MAX_CONCURRENT_LAUNCHES", 10)
  58 
  59 # Interval at which to perform autoscaling updates.
  60 AUTOSCALER_UPDATE_INTERVAL_S = env_integer("AUTOSCALER_UPDATE_INTERVAL_S", 5)
  61 
  62 # The autoscaler will attempt to restart Ray on nodes it hasn't heard from
  63 # in more than this interval.
  64 AUTOSCALER_HEARTBEAT_TIMEOUT_S = env_integer("AUTOSCALER_HEARTBEAT_TIMEOUT_S",
  65                                              30)
  66 
  67 # Max number of retries to AWS (default is 5, time increases exponentially)
  68 BOTO_MAX_RETRIES = env_integer("BOTO_MAX_RETRIES", 12)
  69 
  70 # Default logger format: only contains the message.
  71 LOGGER_FORMAT = "%(message)s"
  72 LOGGER_FORMAT_HELP = "The logging format. default='%(message)s'"
  73 LOGGER_LEVEL = "info"
  74 LOGGER_LEVEL_CHOICES = ['debug', 'info', 'warning', 'error', 'critical']
  75 LOGGER_LEVEL_HELP = ("The logging level threshold, choices=['debug', 'info',"
  76                      " 'warning', 'error', 'critical'], default='info'")
  77
  [end of python/ray/ray_constants.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/python/ray/ray_constants.py b/python/ray/ray_constants.py
  --- a/python/ray/ray_constants.py
  +++ b/python/ray/ray_constants.py
  @@ -42,6 +42,7 @@
   WORKER_DIED_PUSH_ERROR = "worker_died"
   PUT_RECONSTRUCTION_PUSH_ERROR = "put_reconstruction"
   HASH_MISMATCH_PUSH_ERROR = "object_hash_mismatch"
  +INFEASIBLE_TASK_ERROR = "infeasible_task"
   
   # Abort autoscaling if more than this number of errors are encountered. This
   # is a safety feature to prevent e.g. runaway node launches.
  
verification_info: {"golden_diff": "diff --git a/python/ray/ray_constants.py b/python/ray/ray_constants.py\n--- a/python/ray/ray_constants.py\n+++ b/python/ray/ray_constants.py\n@@ -42,6 +42,7 @@\n WORKER_DIED_PUSH_ERROR = \"worker_died\"\n PUT_RECONSTRUCTION_PUSH_ERROR = \"put_reconstruction\"\n HASH_MISMATCH_PUSH_ERROR = \"object_hash_mismatch\"\n+INFEASIBLE_TASK_ERROR = \"infeasible_task\"\n \n # Abort autoscaling if more than this number of errors are encountered. This\n # is a safety feature to prevent e.g. runaway node launches.\n", "issue": "[xray] Users get no warning for infeasible tasks.\nStart Ray with \r\n\r\n```\r\nRAY_USE_XRAY=1 ray start --head --redis-port=6379 --num-gpus=0\r\n```\r\n\r\nThen start `RAY_USE_XRAY=1 ipython` and run\r\n\r\n```python\r\nimport ray\r\n\r\nray.init(redis_address='localhost:6379')\r\n\r\n@ray.remote(num_gpus=1)\r\ndef f():\r\n    return 1\r\n\r\nf.remote()\r\n```\r\n\r\n`f` will never execute because it is infeasible, and yet the user will get no warning.\n", "before_files": [{"content": "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\"\"\"Ray constants used in the Python code.\"\"\"\n\nimport os\n\nimport ray\n\n\ndef env_integer(key, default):\n    if key in os.environ:\n        return int(os.environ[key])\n    return default\n\n\nID_SIZE = 20\nNIL_JOB_ID = ray.ObjectID(ID_SIZE * b\"\\x00\")\n\n# If a remote function or actor (or some other export) has serialized size\n# greater than this quantity, print an warning.\nPICKLE_OBJECT_WARNING_SIZE = 10**7\n\n# The maximum resource quantity that is allowed. TODO(rkn): This could be\n# relaxed, but the current implementation of the node manager will be slower\n# for large resource quantities due to bookkeeping of specific resource IDs.\nMAX_RESOURCE_QUANTITY = 512\n\n# Different types of Ray errors that can be pushed to the driver.\n# TODO(rkn): These should be defined in flatbuffers and must be synced with\n# the existing C++ definitions.\nWAIT_FOR_CLASS_PUSH_ERROR = \"wait_for_class\"\nPICKLING_LARGE_OBJECT_PUSH_ERROR = \"pickling_large_object\"\nWAIT_FOR_FUNCTION_PUSH_ERROR = \"wait_for_function\"\nTASK_PUSH_ERROR = \"task\"\nREGISTER_REMOTE_FUNCTION_PUSH_ERROR = \"register_remote_function\"\nFUNCTION_TO_RUN_PUSH_ERROR = \"function_to_run\"\nVERSION_MISMATCH_PUSH_ERROR = \"version_mismatch\"\nCHECKPOINT_PUSH_ERROR = \"checkpoint\"\nREGISTER_ACTOR_PUSH_ERROR = \"register_actor\"\nWORKER_CRASH_PUSH_ERROR = \"worker_crash\"\nWORKER_DIED_PUSH_ERROR = \"worker_died\"\nPUT_RECONSTRUCTION_PUSH_ERROR = \"put_reconstruction\"\nHASH_MISMATCH_PUSH_ERROR = \"object_hash_mismatch\"\n\n# Abort autoscaling if more than this number of errors are encountered. This\n# is a safety feature to prevent e.g. runaway node launches.\nAUTOSCALER_MAX_NUM_FAILURES = env_integer(\"AUTOSCALER_MAX_NUM_FAILURES\", 5)\n\n# The maximum number of nodes to launch in a single request.\n# Multiple requests may be made for this batch size, up to\n# the limit of AUTOSCALER_MAX_CONCURRENT_LAUNCHES.\nAUTOSCALER_MAX_LAUNCH_BATCH = env_integer(\"AUTOSCALER_MAX_LAUNCH_BATCH\", 5)\n\n# Max number of nodes to launch at a time.\nAUTOSCALER_MAX_CONCURRENT_LAUNCHES = env_integer(\n    \"AUTOSCALER_MAX_CONCURRENT_LAUNCHES\", 10)\n\n# Interval at which to perform autoscaling updates.\nAUTOSCALER_UPDATE_INTERVAL_S = env_integer(\"AUTOSCALER_UPDATE_INTERVAL_S\", 5)\n\n# The autoscaler will attempt to restart Ray on nodes it hasn't heard from\n# in more than this interval.\nAUTOSCALER_HEARTBEAT_TIMEOUT_S = env_integer(\"AUTOSCALER_HEARTBEAT_TIMEOUT_S\",\n                                             30)\n\n# Max number of retries to AWS (default is 5, time increases exponentially)\nBOTO_MAX_RETRIES = env_integer(\"BOTO_MAX_RETRIES\", 12)\n\n# Default logger format: only contains the message.\nLOGGER_FORMAT = \"%(message)s\"\nLOGGER_FORMAT_HELP = \"The logging format. default='%(message)s'\"\nLOGGER_LEVEL = \"info\"\nLOGGER_LEVEL_CHOICES = ['debug', 'info', 'warning', 'error', 'critical']\nLOGGER_LEVEL_HELP = (\"The logging level threshold, choices=['debug', 'info',\"\n                     \" 'warning', 'error', 'critical'], default='info'\")\n", "path": "python/ray/ray_constants.py"}]}