Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Requestor cannot accept a WantToComputeTask message with price set to 0 #3936

Closed
2 tasks done
shadeofblue opened this issue Feb 28, 2019 · 6 comments
Closed
2 tasks done
Assignees

Comments

@shadeofblue
Copy link
Contributor

shadeofblue commented Feb 28, 2019

  • add an integration test that reproduces this issue
  • addresss the issue

When receiving the WantToComputeTask message, the processing crashes when the price specified by the provider is set to 0

@etam
Copy link
Contributor

etam commented Mar 5, 2019

2019-03-05 13:18:57 CRITICAL twisted                             Unhandled Error                                                                                                                                                                                               
Traceback (most recent call last):                                                                                                                                                                                                                                             
  File "/home/etam/code/github/golemfactory/golem/fix_free_providers/venv/lib/python3.6/site-packages/twisted/python/log.py", line 103, in callWithLogger                                                                                                                      
    return callWithContext({"system": lp}, func, *args, **kw)                                                                                                                                                                                                                  
  File "/home/etam/code/github/golemfactory/golem/fix_free_providers/venv/lib/python3.6/site-packages/twisted/python/log.py", line 86, in callWithContext                                                                                                                      
    return context.call({ILogContext: newCtx}, func, *args, **kw)                                                                                                                                                                                                              
  File "/home/etam/code/github/golemfactory/golem/fix_free_providers/venv/lib/python3.6/site-packages/twisted/python/context.py", line 122, in callWithContext                                                                                                                 
    return self.currentContext().callWithContext(ctx, func, *args, **kw)                                                                                                                                                                                                       
  File "/home/etam/code/github/golemfactory/golem/fix_free_providers/venv/lib/python3.6/site-packages/twisted/python/context.py", line 85, in callWithContext                                                                                                                  
    return func(*args,**kw)                                                                                                                                                                                                                                                    
--- <exception caught here> ---                                                                                                                                                                                                                                                
  File "/home/etam/code/github/golemfactory/golem/fix_free_providers/venv/lib/python3.6/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite                                                                                                              
    why = selectable.doRead()                                                                                                                                                                                                                                                  
  File "/home/etam/code/github/golemfactory/golem/fix_free_providers/venv/lib/python3.6/site-packages/twisted/internet/tcp.py", line 205, in doRead                                                                                                                            
    return self._dataReceived(data)                                                                                                                                                                                                                                            
  File "/home/etam/code/github/golemfactory/golem/fix_free_providers/venv/lib/python3.6/site-packages/twisted/internet/tcp.py", line 211, in _dataReceived                                                                                                                     
    rval = self.protocol.dataReceived(data)                                                                                                                                                                                                                                    
  File "/home/etam/code/github/golemfactory/golem/fix_free_providers/golem/network/transport/tcpnetwork.py", line 335, in dataReceived                                                                                                                                         
    self._interpret(data)                                                                                                                                                                                                                                                      
  File "/home/etam/code/github/golemfactory/golem/fix_free_providers/golem/network/transport/tcpnetwork.py", line 361, in _interpret                                                                                                                                           
    self.session.interpret(m)                                                                                                                                                                                                                                                  
  File "/home/etam/code/github/golemfactory/golem/fix_free_providers/golem/task/tasksession.py", line 163, in interpret                                                                                                                                                        
    BasicSafeSession.interpret(self, msg)                                                                                                                                                                                                                                      
  File "/home/etam/code/github/golemfactory/golem/fix_free_providers/golem/network/transport/session.py", line 75, in interpret                                                                                                                                                
    action(msg)                                                                                                                                                                                                                                                                
  File "/home/etam/code/github/golemfactory/golem/fix_free_providers/golem/task/tasksession.py", line 626, in _react_to_want_to_compute_task                                                                                                                                   
    scaled_price=task.header.max_price / msg.price,                                                                                                                                                                                                                            
builtins.ZeroDivisionError: division by zero                                                                                                                                                                                                                                   

@etam
Copy link
Contributor

etam commented Mar 6, 2019

@Krigpl In comment to #3453 you wrote

Using scaled_price which is price / max_price

but in #3479 you implemented

scaled_price=task.header.max_price / msg.price

Which one is correct?

@Wiezzel
Copy link

Wiezzel commented Mar 6, 2019

@etam I'm not expert in marketplace but price / max_price looks much more reasonable than max_price / price.

etam added a commit that referenced this issue Mar 6, 2019
etam added a commit that referenced this issue Mar 7, 2019
etam added a commit that referenced this issue Mar 8, 2019
@etam
Copy link
Contributor

etam commented Mar 8, 2019

merged

@etam etam closed this as completed Mar 8, 2019
@ghost ghost removed the in progress label Mar 8, 2019
@etam
Copy link
Contributor

etam commented Mar 19, 2019

follow up: #3976

@ZmijaWA ZmijaWA self-assigned this Mar 19, 2019
@ZmijaWA
Copy link
Contributor

ZmijaWA commented Mar 19, 2019

Works fine.
Task started from json file with price 0, provider min price set to 0. Task finished and rendered.

@etam etam removed the _current label Apr 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants