The Wayback Machine - https://web.archive.org/web/20201216173541/https://github.com/AcademySoftwareFoundation/OpenCue/issues/657
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

smallint out of range error for exit codes on windows #657

Open
samkenw opened this issue Mar 13, 2020 · 2 comments
Open

smallint out of range error for exit codes on windows #657

samkenw opened this issue Mar 13, 2020 · 2 comments

Comments

@samkenw
Copy link

@samkenw samkenw commented Mar 13, 2020

I am getting the following error on windows:

Exception in thread Thread-120:
Traceback (most recent call last):
  File "[...]\deploy\py37\lib\threading.py", line 926, in _bootstrap_inner
    self.run()
  File "[...]\deploy\py37\lib\site-packages\rqd-unknown-py3.7.egg\rqd\rqcore.py", line 540, in run
    self.__sendFrameCompleteReport()
  File "[...]\deploy\py37\lib\site-packages\rqd-unknown-py3.7.egg\rqd\rqcore.py", line 219, in __sendFrameCompleteReport
    self.rqCore.network.reportRunningFrameCompletion(report)
  File "[...]\deploy\py37\lib\site-packages\rqd-unknown-py3.7.egg\rqd\rqnetwork.py", line 240, in reportRunningFrameCompletion
    stub.ReportRunningFrameCompletion(request, timeout=rqd.rqconstants.RQD_TIMEOUT)
  File "[...]\deploy\py37\lib\site-packages\grpc\_channel.py", line 533, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "[...]\deploy\py37\lib\site-packages\grpc\_channel.py", line 467, in _end_unary_response_blocking
    raise _Rendezvous(state, None, None, deadline)
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
        status = StatusCode.INTERNAL
        details = "com.imageworks.spcue.dispatcher.RqdRetryReportException: error processing the frame complete report, sending retry message to RQD org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [UPDATE frame SET str_state=?, int_exit_status = ?, ts_stopped = current_timestamp + interval '1' second, ts_updated = current_timestamp, int_mem_max_used = ?, int_version = int_version + 1, int_total_past_core_time = int_total_past_core_time + round(INTERVAL_TO_SECONDS(current_timestamp + interval '1' second - ts_started) * int_cores / 100) WHERE frame.pk_frame = ? AND frame.str_state = ? AND frame.int_version = ? ]; ERROR: smallint out of range
  Where: SQL statement "UPDATE
              frame_history
          SET
              int_mem_max_used=$1,
              int_ts_stopped=$2,
              int_exit_status=$3,
              int_checkpoint_count=$4
          WHERE
              int_ts_stopped = 0 AND pk_frame=$5"
PL/pgSQL function trigger__frame_history_open() line 19 at EXECUTE; nested exception is org.postgresql.util.PSQLException: ERROR: smallint out of range
  Where: SQL statement "UPDATE
              frame_history
          SET
              int_mem_max_used=$1,
              int_ts_stopped=$2,
              int_exit_status=$3,
              int_checkpoint_count=$4
          WHERE
              int_ts_stopped = 0 AND pk_frame=$5"
PL/pgSQL function trigger__frame_history_open() line 19 at EXECUTE
error processing the frame complete report, sending retry message to RQD org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [UPDATE frame SET str_state=?, int_exit_status = ?, ts_stopped = current_timestamp + interval '1' second, ts_updated = current_timestamp, int_mem_max_used = ?, int_version = int_version + 1, int_total_past_core_time = int_total_past_core_time + round(INTERVAL_TO_SECONDS(current_timestamp + interval '1' second - ts_started) * int_cores / 100) WHERE frame.pk_frame = ? AND frame.str_state = ? AND frame.int_version = ? ]; ERROR: smallint out of range
  Where: SQL statement "UPDATE
              frame_history
          SET
              int_mem_max_used=$1,
              int_ts_stopped=$2,
              int_exit_status=$3,
              int_checkpoint_count=$4
          WHERE
              int_ts_stopped = 0 AND pk_frame=$5"
PL/pgSQL function trigger__frame_history_open() line 19 at EXECUTE; nested exception is org.postgresql.util.PSQLException: ERROR: smallint out of range
  Where: SQL statement "UPDATE
              frame_history
          SET
              int_mem_max_used=$1,
              int_ts_stopped=$2,
              int_exit_status=$3,
              int_checkpoint_count=$4
          WHERE
              int_ts_stopped = 0 AND pk_frame=$5"
PL/pgSQL function trigger__frame_history_open() line 19 at EXECUTE"
        debug_error_string = "{"created":"@1584117532.535000000","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1017,"grpc_message":"com.imageworks.spcue.dispatcher.RqdRetryReportException: error processing the frame complete report, sending retry message to RQD org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [UPDATE frame SET str_state=?, int_exit_status = ?, ts_stopped = current_timestamp + interval '1' second, ts_updated = current_timestamp, int_mem_max_used = ?, int_version = int_version + 1, int_total_past_core_time = int_total_past_core_time + round(INTERVAL_TO_SECONDS(current_timestamp + interval '1' second - ts_started) * int_cores / 100) WHERE frame.pk_frame = ? AND frame.str_state = ? AND frame.int_version = ? ]; ERROR: smallint out of range\n  Where: SQL statement "UPDATE\n              frame_history\n
      SET\n              int_mem_max_used=$1,\n              int_ts_stopped=$2,\n              int_exit_status=$3,\n              int_checkpoint_count=$4\n          WHERE\n              int_ts_stopped = 0 AND pk_frame=$5"\nPL/pgSQL function trigger__frame_history_open() line 19 at EXECUTE; nested exception is org.postgresql.util.PSQLException: ERROR: smallint out of range\n  Where: SQL statement "UPDATE\n              frame_history\n          SET\n
          int_mem_max_used=$1,\n              int_ts_stopped=$2,\n              int_exit_status=$3,\n
 int_checkpoint_count=$4\n          WHERE\n              int_ts_stopped = 0 AND pk_frame=$5"\nPL/pgSQL function trigger__frame_history_open() line 19 at EXECUTE\nerror processing the frame complete report, sending retry message to RQD org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [UPDATE frame SET str_state=?, int_exit_status = ?, ts_stopped = current_timestamp + interval '1' second, ts_updated = current_timestamp, int_mem_max_used = ?, int_version = int_version + 1, int_total_past_core_time = int_total_past_core_time + round(INTERVAL_TO_SECONDS(current_timestamp + interval '1' second - ts_started) * int_cores / 100) WHERE frame.pk_frame = ? AND frame.str_state = ? AND frame.int_version = ? ]; ERROR: smallint out of range\n  Where: SQL statement "UPDATE\n              frame_history\n          SET\n              int_mem_max_used=$1,\n              int_ts_stopped=$2,\n              int_exit_status=$3,\n              int_checkpoint_count=$4\n          WHERE\n
int_ts_stopped = 0 AND pk_frame=$5"\nPL/pgSQL function trigger__frame_history_open() line 19 at EXECUTE; nested exception is org.postgresql.util.PSQLException: ERROR: smallint out of range\n  Where: SQL statement "UPDATE\n
        frame_history\n          SET\n              int_mem_max_used=$1,\n              int_ts_stopped=$2,\n
        int_exit_status=$3,\n              int_checkpoint_count=$4\n          WHERE\n              int_ts_stopped = 0 AND pk_frame=$5"\nPL/pgSQL function trigger__frame_history_open() line 19 at EXECUTE","grpc_status":13}"
>

Windows allows unsigned 32Bit exit codes which are larger than the smallint type of int_exit_status.
We could change the type of int_exit_status to INTEGER but since postgres only has signed integers this would mean that we could still only represent half of the exit codes.
The other option would be BIGINT but thats 8bytes which would be a lot of storage.

https://docs.microsoft.com/en-gb/windows/win32/api/processthreadsapi/nf-processthreadsapi-exitprocess?redirectedfrom=MSDN

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/52ddd4c3-55b9-4e03-8287-5392aac0627f

@samkenw samkenw changed the title smallint out of range error fo exit code on windows smallint out of range error for exit codes on windows Mar 13, 2020
@bcipriano bcipriano added this to To do in OpenCue Backlog via automation Mar 17, 2020
@nimeshvashistha
Copy link

@nimeshvashistha nimeshvashistha commented Mar 18, 2020

@bcipriano I would like to take this issue up.

@bcipriano
Copy link
Collaborator

@bcipriano bcipriano commented Mar 18, 2020

Sounds good, I've assigned it to you!

OpenCue uses database migrations to manage its database schema; Flyway has a good doc explaining this: https://flywaydb.org/getstarted/why

Basically you will want to create a new migration file which makes the schema change. PR #618 is a good example to work from.

Setting Up the Database | Apply Migrations from Source shows how this works in practice; once you have a migration, run flyway to apply it and test it.

There may be Cuebot changes needed to support the new datatype; again #618 is a good example of the Cuebot changes that were needed in that particular instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.